I\'m trying to cross-compile a 64-bit executable on a 32-bit ubuntu system. This works up until linking, where it fails due to the lack of a 64-bit glib2 (libglib-2.0.a).
There a couple of ways of going about this. The most straight-forward is to download a toolchain that comes with target libraries you need. Given that this is most likely not going to happen, here's one way to solve this problem.
I'm going to assume that you're using gcc as your cross-compiler.
In your Makefile (or command line) set CFLAGS (and CXXFLAGS if C++) to the following:
-L /path/to/target/libs -Wl,-rpath-link /same/path/as/first
Note that -Wl, and -rpath-link do not have a space between them, it has to be this way.
-L adds library path for the compiler to look at. The second argument, -Wl,-rpath-link adds the path for the linker. You have to have both, otherwise the compiler will resolve the symbols but the linker will whine that it doesn't have the library to link nagainst.