Building a 32-bit app in 64-bit Ubuntu

后端 未结 2 1629
终归单人心
终归单人心 2021-01-05 17:18

After hours of googling, I decide to give up and ask you experts. I am trying to build a 32-bit application (xgap if anyone interested) in my 64 Ubuntu 11.10. I added the

相关标签:
2条回答
  • 2021-01-05 17:23

    I solved the problem. I think that gcc was expecting a static library archive. I used the getlibs script from http://ubuntuforums.org/showthread.php?t=474790 to download all the .a archives needed for linking. Then gcc worked. I think gcc did search in /usr/lib32 directory but didn't find the .a archives so went on to search in the standard directory which is /usr/lib, where it finds the incompatible *.so files.

    But then the question is: the *.so files in /usr/lib32/ from package ia32-libs doesn't really have the libraries needed for linking? What are those files in /usr/lib32/ used for?

    0 讨论(0)
  • 2021-01-05 17:47

    You need to use link with -m32 as well.

    gcc -m32 -o xgap xcmds.o utils.o gapgraph.o gaptext.o pty.o popdial.o xgap.o selfile.o   -L/usr/lib32 -lXaw -lXmu -lXt -lXext -lX11  -lSM -lICE
    

    All things considered, I think you should be able to drop the -L/usr/lib32 when using -m32.

    0 讨论(0)
提交回复
热议问题