while cross compiling (application)"arm-eabi-gcc -static -o hello hello.c" following error occurring
hello.c:1:18: error: stdio.h: No such file or directory
hello.c:2:19: error: stdlib.h: No such file or directory
hello.c:3:19: error: string.h: No such file or directory
hello.c:4:19: error: fcntl.h: No such file or directory
hello.c:5:20: error: unistd.h: No such file or directory
hello.c:6:23: error: sys/types.h: No such file or directory
hello.c:7:22: error: sys/stat.h: No such file or directory
hello.c:8:23: error: sys/ioctl.h: No such file or directory
`
I am able to cross compile kernel modules.
if you try to cross-compile user program in linux machine, you shoud use not arm-eabi-gcc but arm-linux-gnueabi-gcc.
you have a broken crosscompiler. Get a better toolchain, you have a lot of options:
OpenEmbedded
Yocto
Buildroot
Scratchbox
Related
I'm trying to cross compile a C file to an aarch64 ELF on x86 linux. I've set up a cross build environment on Gentoo but when I run the following command:
clang -target aarch64-unknown-linux-gnu --sysroot=/usr/aarch64-unknown-linux-gnu/ input.c -I /usr/lib/gcc/aarch64-unknown-linux-gnu/11.3.0/ -L /usr/lib/gcc/aarch64-unknown-linux-gnu/11.3.0/
I get the following error:
/usr/bin/aarch64-unknown-linux-gnu-ld: cannot find crtbeginS.o: No such file or directory
However, in the directory /usr/lib/gcc/aarch64-unknown-linux-gnu/11.3.0/, there is a file called crtbeginS.o. My question then is what additional compiler flags am I missing to get the linker to find this file?
Trying to run the Uart code on Platformio in VS code, using Windows 11. Using esp32 dev kit, when try to build the example code,running into the below issue
It's unable to create .o object file
Fatal error: can't create .pio\build\esp32-s3-devkitc-1\libsodium\libsodium\src\libsodium\crypto_box\curve25519xchacha20poly1305\box_seal_curve25519xchacha20poly1305.o: No such file or directory
Assembler messages:
Fatal error: can't create .pio\build\esp32-s3-devkitc-1\libsodium\libsodium\src\libsodium\crypto_box\curve25519xchacha20poly1305\box_seal_curve25519xchacha20poly1305.o: No such file or directory
Compiling .pio\build\esp32-s3-devkitc-1\libsodium\libsodium\src\libsodium\crypto_scalarmult\curve25519\sandy2x\consts.o
Compiling .pio\build\esp32-s3-devkitc-1\libsodium\libsodium\src\libsodium\crypto_scalarmult\curve25519\sandy2x\curve25519_sandy2x.o
Compiling .pio\build\esp32-s3-devkitc-1\libsodium\libsodium\src\libsodium\crypto_scalarmult\curve25519\sandy2x\fe51_invert.o
Assembler messages:
Fatal error: can't create .pio\build\esp32-s3-devkitc-1\libsodium\libsodium\src\libsodium\crypto_box\curve25519xchacha20poly1305\box_curve25519xchacha20poly1305.o: No such file or directory
Compiling .pio\build\esp32-s3-devkitc-1\libsodium\libsodium\src\libsodium\crypto_scalarmult\curve25519\sandy2x\fe51_mul.o
Compiling .pio\build\esp32-s3-devkitc-1\libsodium\libsodium\src\libsodium\crypto_scalarmult\curve25519\sandy2x\fe51_nsquare.o
Compiling .pio\build\esp32-s3-devkitc-1\libsodium\libsodium\src\libsodium\crypto_scalarmult\curve25519\sandy2x\fe51_pack.o
*** [.pio\build\esp32-s3-devkitc-1\libsodium\libsodium\src\libsodium\crypto_box\curve25519xchacha20poly1305\box_seal_curve25519xchacha20poly1305.o] Error 1
*** [.pio\build\esp32-s3-devkitc-1\libsodium\libsodium\src\libsodium\crypto_box\curve25519xchacha20poly1305\box_curve25519xchacha20poly1305.o] Error 1
Assembler messages:
Fatal error: can't create .pio\build\esp32-s3-devkitc-1\libsodium\libsodium\src\libsodium\crypto_pwhash\scryptsalsa208sha256\nosse\pwhash_scryptsalsa208sha256_nosse.o: No such file or directory
*** [.pio\build\esp32-s3-devkitc-1\libsodium\libsodium\src\libsodium\crypto_pwhash\scryptsalsa208sha256\nosse\pwhash_scryptsalsa208sha256_nosse.o] Error 1 ```
I was able to resolve this issue by cloning/changing the project folder on to the drive close to the root as possible i.e. C:\examples\espidf-peripherals-uart
This looks like the limitations PATH length on Windows. More details https://github.com/esp-rs/rust/discussions/88#discussioncomment-1581167
I am trying to build OpenFOAM from source with MPICH-3.3.2 but got
g++ -std=c++11 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3 -DNoRepository -ftemplate-depth-100 -I -IlnInclude -I. -I/home/pranto/OpenFOAM-dev/src/OpenFOAM/lnInclude -I/home/pranto/OpenFOAM-dev/src/OSspecific/POSIX/lnInclude -fPIC -c PstreamGlobals.C -o /home/pranto/OpenFOAM-dev/platforms/linux64GccDPInt32OptSYSTEMMPI/src/Pstream/mpi/PstreamGlobals.o
UPstream.C:30:17: fatal error: mpi.h: No such file or directory
compilation terminated.
/home/pranto/OpenFOAM-dev/wmake/rules/General/transform:25: recipe for target '/home/pranto/OpenFOAM-dev/platforms/linux64GccDPInt32OptSYSTEMMPI/src/Pstream/mpi/UPstream.o' failed
make[4]: *** [/home/pranto/OpenFOAM-dev/platforms/linux64GccDPInt32OptSYSTEMMPI/src/Pstream/mpi/UPstream.o] Error 1
make[4]: *** Waiting for unfinished jobs....
In file included from PstreamGlobals.C:26:0:
PstreamGlobals.H:41:17: fatal error: mpi.h: No such file or directory
compilation terminated.
In file included from UIPread.C:30:0:
PstreamGlobals.H:41:17: fatal error: mpi.h: No such file or directory
compilation terminated.
Although I set export WM_MPLIB=SYSTEMMPI in etc/bashrc.
But with the OpenMPI everything is ok.
What are the additional settings I have to consider to build OpenFOAM with MPICH-3.3.2?
In the "openfoma/etc" directory, there is a setting file for mpi where you can change the version and the location of the mpich you used. Hope this will help you. By the way, it is not necessary to set the bashrc file.
I'm very very new to programming and mostly self taught (using command prompt). I tried to compile a c file that has multiple words as its filename and it showed error for all the words.
Example:
C:\Users\User\Desktop\Programming\toCompile>gcc -o Even or odd.exe
Even or Odd determinator.c
gcc: error: or: No such file or directory
gcc: error: odd.exe: No such file or directory
gcc: error: Even: No such file or directory
gcc: error: or: No such file or directory
gcc: error: Odd: No such file or directory
gcc: error: determinator.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
Do I have to rename the c files to one word names or is there another way?
Surround the file names in ' or ".
gcc -o 'Even or odd.exe' 'Even or Odd determinator.c'
But in the future, I'd avoid spaces in file names. Some build systems (make) can't work with spaces.
I try to put the md5 function into udpcli01.c file. Then compile $ cc -o udpcli01 udpcli01.c -lcrypto.
There is a fatal error :udpcli01.c:1:17: fatal error: unp.h: No such file or directory
#include "unp.h"
^
compilation terminated.
how to fix it?
The MD5_Init, MD5_Update, and MD5_Final functions are part of the "libcrypto" library (which is part of OpenSSL). Link against it by passing -lcrypto while linking your application.