Cross-compile to ARM64 (AARCH64) on Intel 64-bit Red Hat 7.5 can't find dlfcn.h, cstddef.h, etc

Viewed 1950

I have a program that compiles in gcc fine on Red Hat 64-bit Linux. I run and it works perfectly fine to make a shared object file:

gcc -ansi -std=c++11-shared -fPIC...etc

I am trying to cross-compile for 64-bit ARM (AARCH64) on this same machine.

I installed the cross-compile tools:

sudo yum install gcc-aarch64-linux-gnu
sudo yum install gcc-c++-aarch64-linux-gnu

However, when I run the same command that works fine, just running as

aarch64-linux-gnu-gcc -ansi -std=c++11 -shared -fPIC...etc

It gets the errors and doesn't build:

 fatal error: dlfcn.h: No such file or directory
 #include <dlfcn.h>

If I comment that out, it hits the next includes of cstddef.h fatal error not found, etc

How do I make this work?

0 Answers
Related