no stdint.h file on Debian - c

I'm trying to use Chibios. The example code they provide seems to need stdint.h file. The Makefile gives the following error:
/usr/lib/gcc/arm-none-eabi/4.8/include/stdint.h:9:26: fatal error: stdint.h: No such file or directory
# include_next <stdint.h>
^
compilation terminated.
../../os/ports/GCC/ARMCMx/rules.mk:182: recipe for target 'build/obj/crt0.o' failed
make: *** [build/obj/crt0.o] Error 1
I could find nothing useful in the web.

#include_next is used to let one file augment another one with the same name. In this case, it seems the "other one" is not available.
I got the same error trying to compile my code using the gcc-arm package in Linux Mint, gcc-arm-none-eabi. I got past this problem by installing libnewlib-arm-none-eabi: sudo apt-get install libnewlib-arm-none-eabi

try this:
apt-get install avr-libc
Hmm, my answer is not suit for ARM, just wish other avr users can get help when they meet the same question.

Probably you forgot to specify -ffreestanding option of gcc.

With valuable helps of gcc-arm-embedded team (here) I managed to compile Chibios demo program successfully. I downloaded gcc-arm-none-eabi-4_8-2014q1 from their launchpad site and it worked just fine.

Related

FFmpeg: building example C codes

I have configured and compiled the FFmpeg library using this link:
https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu
Now, I am trying to build example C codes provided by FFmpeg from here:
https://github.com/FFmpeg/FFmpeg/tree/master/doc/examples
However, when I run make install-examples or make install (suggested by /example/README), I receive this kind of message:
make: *** No rule to make target '/doc/examples/README', needed by
'install-examples'. Stop.
I thought this may be due to the rules not being in the correct MakeFile format (I am not sure why they refers to README). How should I go about in fixing this and compiling the example codes? I have tried to find solutions about this, but there doesn't seem to be much information online.
Thank you.
Run ./configure && make -j4 examples in the FFmpeg source directory, then look in doc/examples for the compiled examples.
Requires make and pkg-config.
To remove the compiled examples use make examplesclean in the FFmpeg source directory.
nasm/yasm not found or too old. Use --disable-x86asm for a crippled build. If you think to configure made a mistake, make sure you are using the latest version from Git. If the latest version fails, report the problem to theffmpeg-user#ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.Include the log file "ffbuild/config.log" produced by configure as this will help solve the problem.
If you see this when you execute the above command then do this
macOS:
brew install yasm
Ubuntu:
sudo apt-get install yasm

(Kali & Ettercap) Plugin compilation error

Okay I'm having a particular issue during compilation using the command gcc -shared -o attack_test.so -fPIC attack_test.c. Specifically, when I run the command, I get the error fatal error: ec.h: No such file or directory. Any idea how to fix this issue? Thanks.
EDIT: To give a little more issue background, I'm running this command from the desktop, where my C source code is located. Perhaps there's a specific place I need to put the source and run the command?
EDIT 2: So I was able to get past the above error by running the command sudo apt-get install libssl-dev, and then changing the line #include <ec.h> to #include <openssl/ec.h>, which seemed to negate the issue. Adding the <openssl/...> to the other includes did not work the same way. So now, instead of fatal error: ec.h: No such file or directory, it's fatal error: ec_plugins.h: No such file or directory. Any ideas for possible fixes? Thanks so much!
For reference, I'm building upon the the dos_attack.c source code from this link.
TO BE CLEAR: This is for a project and tested upon in a CLOSED ENVIRONMENT. This is COMPLETELY* for EDUCATIONAL use and for the study of Denial-of-Service and Man-In-the-Middle mitigation techniques.
<ec.h> is intended to refer to a file in the Ettercap include directory, not an OpenSSL header. The same goes for the other ec_*.h headers.
Adding -I/path/to/ettercap/include to your compiler flags should fix this.

Struggling to get PortAudio to Work with MinGW

I have the MinGW install previously working fine with MSYS. They are installed properly and functioning just well.
I installed the PortAudio library and did the install and got the success message after:
./configure
make
make install
When I try to compile samples:
c:\c>gcc patest_mono.c -o pa.exe
patest_mono.c:50:23: fatal error: portaudio.h: No such file or directory
#include "portaudio.h"
^
compilation terminated.
I'm new. I have a feeling I might be doing something fundamentally wrong with the way I'm trying to create the exe from compiling. It's been somewhat of a puzzle quest so far, but I've tried to figure it out and think I am close but completely missing something.
PATH variable ?
In the PortAudio MinGW build instructions I noticed
"The above should create a working version though you might want to
provide '–prefix=<path-to-install-dir>' to configure. "
I've tried adding C:\MingW\PortAudio into the user path. Doesn't work.
I've also tried running the commands in Bash and they come back with an error message "No Rule to make target 'paexpink'" either with the make command, and with gcc .c -o .exe I just get the same error message as compiling straight from the cmd prompt.
I found another source on stack overflow thread with no answers, but the user had commented that http://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio provided them a solution but I tried installing the 5 cpython binaries and under the assumption I did it right, it didn't work either.
Thanks for your help,
Julian
To build and install portaudio, you need to add -prefix=/c/<"path to base of the MinGW directory"> to the ./configure line.
For example: ./configure -prefix=/c/MinGW/
then continue the installation by doing
make
After that, do the
make install
and that should install the portaudio files into MinGW.
After it has finished installing, you need to add -lportaudio to the compile command whenever you compile any programs that you want to use PortAudio in.
For example: gcc -o test test.c -lportaudio
I just figured out how to do this today, so I may have accidentally forgotten a few steps.

Source file not compiled Dev C++

I just installed Dev C++ and I am learning C programming.
the code i used was
#include <stdio.h>
int main()
{
printf("Hello world");
getch();
}
I saved it as a .c file. When I compile it works fine, but when I compile and run it says source file not compiled. So I googled buncha things and came across this video on youtube which shows you how to fix it. I also saw other forums on google which suggest the same thing... However, after doing whats asked, Now I can't even compile my code. I get this error
Compiler: Default compiler
Executing C:\Dev-Cpp\bin\gcc.exe...
C:\Dev-Cpp\bin\gcc.exe "C:\Users\ubaid\Documents\C\Untitled1.c" -o "C:\Users\ubaid\Documents\C\Untitled1.exe" -I"C:\Dev-Cpp\include" -L"C:\Dev-Cpp\lib"
gcc.exe: Internal error: Aborted (program collect2)
Please submit a full bug report.
See <URL:http://www.mingw.org/bugs.shtml> for instructions.
Execution terminated
I have also used what is asked on this link, and still no luck..
http://learntogeek.com/miscellaneous/solved-source-file-not-compiled-error-in-dev-cpp/
I am using windows 8
I was having this issue and fixed it by going to:
C:\Dev-Cpp\libexec\gcc\mingw32\3.4.2
, then deleting collect2.exe
Install new version of Dev c++. It works fine in Windows 8. It also supports 64 bit version.
Download link is http://sourceforge.net/projects/orwelldevcpp/ .
I guess you're using windows 7 with the Orwell Dev CPP
This version of Dev CPP is good for windows 8 only. However on Windows 7 you need the older version of it which is devcpp-4.9.9.2_setup.exe
Download it from the link and use it.
(Don't forget to uninstall any other version already installed on your pc)
Also note that the older version does not work with windows 8.
This maybe because the c compiler is designed to work in linux.I had this problem too and to fix it go to tools and select compiler options.In the box click on programs
Now you will see a tab with gcc and make and the respective path to it.Edit the gcc and make path to use mingw32-c++.exe and mingw32-make.exe respectively.Now it will work.
The reason was that you were using compilers built for linux.
You can always try doing it manually from the command prompt. Navigate to the path of the file and type:
gcc filename.c -o filename
I found a solution. Please follow the following steps:
Right Click the My comp. Icon
Click Advanced Setting.
CLick Environment Variable. On the top part of Environment Variable Click New
Set Variable name as: PATH then
Set Variable Value as: (" the location of g++ .exe" )
For ex. C:\Program Files (x86)\Dev-Cpp\MinGW64\bin
Click OK
This error occurred because your settings are not correct.
For example I receive
cannot open output file Project1.exe: Permission denied
collect2.exe: error: ld returned 1 exit status
mingw32-make.exe: *** [Project1.exe] Error 1
Because I have no permission to write on my exe file.
After some investigation, and with Dr.Topaz's help, I have learned that you will want to confirm that the program set for g++ in the Compiler Options really does compile the source code. In my case, the C:\Dev-Cpp\bin\g++.exe program did not create an exe, but the C:\Dev-Cpp\bin\c++.exe program did. Either program appears to be intended to take the same arguments and options as GNU g++. I would love to find an actual doc on the Dev-C++ compiler programs, but I have not so far.
You can test the compiler program with a simple example like this:
C:\Dev-Cpp\bin\c++.exe hello.cpp -o hello.exe
Currently in 2021, the Dev-C++ site invites you to download either original Dev-C++ or a newer fork by a group named Embarcadero.
I decided to try the Embarcadero version and the experience was slightly better. The UI is still a tad dated, but the g++.exe program it came with was able to compile programs without issue. Again, take note of where the program is being installed, but in my case, the Embarcadero compiler programs were in C:\Program Files (x86)\Embarcadero\Dev-Cpp\TDM-GCC-64\bin.
Both original Dev-C++ and Embarcadero come with mingw-32 versions of the compiler programs that from what I see do work in a Git Bash console, with slight differences such as not recognizing a default locale when using the command std::cout.imbue(std::locale("")).
I faced this similar error, and none of the solutions worked.
so I tried to download the latest version from here, https://www.bloodshed.net/
I rerun the program.
and everything is now working correctly.
I was facing the same issue as described above.
It can be resolved by creating a new project and creating a new file in that project.
Save the file and then try to build and run.
Hope that helps. :)

I get "lapack.h: No such file or directory" although I installed liblapack-dev

I installed liblapack-dev and its dependencies using Synaptic, and I included <lapack.h> in my code.
If I try to compile my program like this...
mpicc program.c -llapack -o output
...I get the following error:
program.c:4:20: fatal error: lapack.h: No such file or directory
compilation terminated.
How can I fix this? I've already spent hours googling for a solution but nothing helped.
I'm using Linux Mint, but I tried the same thing on the latest version of Ubuntu and it still wouldn't work. Same thing when I try "eliminating" MPI from my program and compiling with gcc.
I experienced a similar issue on Debian. I noticed that
dpkg -L liblapack-dev
did not return a single header file. So I did some searching with apt-cache and found what appears to be C headers. After installing via
sudo apt-get install liblapacke-dev
(note the extra e!), I was able to compile a minimal working example, found here. Modifying the include at the top to read
#include <lapacke.h>
and compiling with
gcc -llapack lapack_example.c
successfully runs on my system. Hope this helps someone.
Answering because it doesn't fit in a comment:
The manual says:
Standard C language APIs for LAPACK
collaboration LAPACK and INTEL Math Kernel Library Team
LAPACK C INTERFACE is now included in the LAPACK package (in the lapacke directory)
LAPACKE User Guide
Updated: April 20, 2012
header files: lapacke.h, lapacke_config.h, lapacke_mangling.h, lapacke_utils.h
so perhaps you need to
#include <lapacke.h>

Resources