help with Gtkmm cross compile please

Discussion in 'Programming' started by nolag, Jul 19, 2010.

  1. #1
    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
     
    nolag, Jul 19, 2010 IP
  2. sacx13

    sacx13 Active Member

    Messages:
    438
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    58
    #2
    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
     
    sacx13, Jul 20, 2010 IP
  3. nolag

    nolag Member

    Messages:
    201
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    28
    #3
    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
     
    nolag, Jul 20, 2010 IP
  4. sacx13

    sacx13 Active Member

    Messages:
    438
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    58
    #4
    sacx13, Jul 21, 2010 IP
  5. nolag

    nolag Member

    Messages:
    201
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    28
    #5
    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)?
     
    nolag, Jul 21, 2010 IP
  6. sacx13

    sacx13 Active Member

    Messages:
    438
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    58
    #6
    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
     
    sacx13, Jul 22, 2010 IP
  7. nolag

    nolag Member

    Messages:
    201
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    28
    #7
    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).
     
    nolag, Jul 22, 2010 IP
  8. sacx13

    sacx13 Active Member

    Messages:
    438
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    58
    #8
    Then you should have all dependencies build by yourself (like gtkmm) .

    Regards
     
    sacx13, Jul 23, 2010 IP
  9. nolag

    nolag Member

    Messages:
    201
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    28
    #9
    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.
     
    nolag, Jul 23, 2010 IP
  10. nolag

    nolag Member

    Messages:
    201
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    28
    #10
    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.
     
    nolag, Jul 23, 2010 IP