Cross compilation requirements for C
- Always use the target headers. They may differ from your host headers. The compiler should already have them as part of its default include path for the standard issue, such as libc.
- You will need to build cURL using the cross compiler into a fake "target" system directory, and build your application with cURL in this target directory. As you need a cURL library as well, you MUST use the cross compiler. For compiles which are not cross compile friendly (such as building programs and running then as part of the compile), you will need to modify the build process. Sometimes
fakeroot
can be helpful for dirty build systems. - You can't arbitrarily use a static library for a different architecture from your system. They must be built by the cross compiler.
- Incorrect. The library generally must be present.
Any library you intend on using, including the libc, must be built for the target platform before you can link against it. Use the target headers instead of the host headers for building so that you're assured of using the correct API.