Cross compilation requirements for C

  1. 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.
  2. 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.
  3. You can't arbitrarily use a static library for a different architecture from your system. They must be built by the cross compiler.
  4. 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.