I have some basic knowledge about C compilation, but you need to get a couple of general cross-compilation answers. In my case, I am trying to cross-compile a program on my Fedora Linux box, which will run on a single board ARM computer.
My first question is about headlines. I downloaded the Linux toolkit for Linux and contains header files, such as stdio.h, in the include directory. Should I use this "target" include directory and not my system, including directories, when I cross-compile? Or is it okay to point to my system, including dirs, such as / usr / include? (These header files seem different when I distinguish them.)
What happens if the header file does not exist. In my case, I also plan to use the cURL library on the ARM board. Can I just point to the include directory present in the curl source package that I downloaded without worrying about the target architecture? If so, does that mean my first question doesn't matter?
Say I want to statically reference a library. Do I need to build this static library for the target ARM platform before this? Or can I use the static libraries installed on my system directly (hoping that the cross-compilation process will take care of the business)?
If I decide to dynamically link to a library, the only requirement would be that the target system has this library compiled for ARM and installed in one of the LD_LIBRARY_PATH directories on the ARM board, is that correct?
Thanks for the help.
fakeroot
Any library that you intend to use, including libc, must be created for the target platform before you can link it. Use target headers instead of host headers to create so you are sure to use the correct API.