I am trying to cross compile a gtkmm game that I made. My system is linux-x64 and I want to cross compile for linux 32 bit. I installed multilib and I have the -m32 in my make file but I get the following error /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.1/../../../libgtkmm-2.4.so when searching for -lgtkmm-2.4 /usr/bin/ld: skipping incompatible /usr/lib/libgtkmm-2.4.so when searching for -lgtkmm-2.4 /usr/bin/ld: cannot find -lgtkmm-2.4 I guess I need to do 2 things but I don't know how 1) how to install gtkmm for 32 bit libraries 2) how to tell g++ where it is (I am using pkg-config gtkmm-2.4 --cflags and pkg-config gtkmm-2.4 --libs). Please PM me or post here if you can help Thanks in advance
First you should start to tell us what distro you are using ? The best method to compile your program is to install your 32bit distro in a chroot and compile it there. It will be most safe. Is very possible to don;t have gtkmm compiled for 32bit under you 64 bite environment and then you should start recompile all gtkmm and its missing dependencies which can be a nightmare. So the fast option is to install your 32 bit distribution in a chroot and compile your application there ! Regards
I am using Linux Mint 8 x64. What is chroot? I know I don't have the 32bit libgtkmm, I want to have both so that I can put it all in one make file and type make and it will make both versions (or make will make one and make game32 will make the other). I see in lib32 there is gtk2.0 stuff (same as lib64) I am hoping to do that with gtkmm. If I do your method will that work? Ultimately I would like to have my computer cross compiling it for as many different computers as possible Thanks for your help! nolag
Take a look here. chroot is a complete new environment (32 bit in your case) which will run on (let say) in the same time with your 64 distribution. Read the following link http://forum.linuxmint.com/viewtopic.php?f=42&t=22432&start=0
Cool. Does it make the OS take up more resources when it runs or does it just sit there until I call it? This seems cool, but how would I use my make file to compile for it when I do make game32? (or even better compile both when I type make)? Also wondering I want to cross for as many things as possible, could I cross compile for unix this way too (or is there even a way to do that)?
It will take only disk space. You should use this chroot only when you want to build a 32 bit binary. In rest you should find another ways to cross compile for other platforms. The best method is to have virtual machines with that environments. Regards
That is the exact opposite of what I want to do. I would like to have (and I know you can) one make file that I simply run and it will put each of the .o files in a folder according to the platform/os it is compiling. It would then compile all of them when I type make. That way I don't need to have all the OSes/architectures that I want to compile for. It would need me to get all the libraries for them and put them somewhere and tell the make file where (what I am trying to figure out how to do).
If I build it myself (compile it for the targets I want?) then how do I tell g++ to look in folder x if it does not find what it is looking for (eg gtkmm is not found in /usr/lib) then look in /usr/lib32 or /usr/cross/32bit? Also how would I get the .so (or do I just compile gtkmm and make it .so as -o libgtkmm-version..so Thanks again for the speedy responses.
I don't mean to dp here but I was thinking if I did do the chroot how would I install libraries for the 32bit os? I want to have gtkmm.