I have a project that is supposed to run on all following platforms:
- Win x86
- Win x64
- Linux (Debian) x86
- Linux (Debian) x64
I'm finish with windows and Linux x64 compiled although I'm not sure it works. There's one platform missing and that's Linux x86. I have a makefile which doesn't care about x64/x32. I need to add a 32bit configuration. I learned that I can do this with make
:
make configuration CFLAGS=-m32
But I'm not so sure it does actual 32bit build - when I used that command, no compilation occurred1 and the program skipped right to the linking phase, where it indeed complained about incompatible libraries2:
/usr/bin/ld: cannot find -lboost_system
/usr/bin/ld: skipping incompatible /usr/lib//liblog4cplus.so when searching for -llog4cplus
/usr/bin/ld: skipping incompatible /usr/lib//liblog4cplus.a when searching for -llog4cplus
/usr/bin/ld: skipping incompatible /usr/local/lib/liblog4cplus.so when searching for -llog4cplus
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.9/../../../liblog4cplus.so when searching for -llog4cplus
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.9/../../../liblog4cplus.a when searching for -llog4cplus
/usr/bin/ld: skipping incompatible //usr/local/lib/liblog4cplus.so when searching for -llog4cplus
/usr/bin/ld: skipping incompatible //usr/lib/liblog4cplus.so when searching for -llog4cplus
/usr/bin/ld: skipping incompatible //usr/lib/liblog4cplus.a when searching for -llog4cplus
/usr/bin/ld: cannot find -llog4cplus
/usr/bin/ld: skipping incompatible /usr/local/ssl/lib//libcrypto.a when searching for -lcrypto
/usr/bin/ld: cannot find -lcrypto
This raises about two questions on people who are used to develop multi-architecture programs:
- How should I manage libraries? And do I have to manually build them all?
- How to properly make the makefile? I suppose the 32bit version and 64bit version should build in different locations...
Note 1: I noticed that this happens because I didn't make clean
. Still, the 64bit and 32bit shouldn't share folders.
Note 2: This includes -lstdc++
- the C++ standard library. This means I don't even have that one.