Search code examples
linuxqtx8664-bitqt4

Using 32bit .so file in a 64bit environment


I am using Ubuntu 12.04 64bit and I am getting the following error while compiling a Qt project which needs a 32bit .so file.

error: skipping incompatible /opt/lib/libEposCmd.so when searching for -lEposCmd

I want to compile this project with -m32 option but I don't know where should I insert this option.


Solution

  • Problem Solved through below instruction:

    • installing g++-multilib, libstdc++.i386, libgcc.i386, glibc-devel.i386, gcc-c++-32bit
    • edite make file and adjust below config:

      cc = add -m32
      CFLAGS = add -m32
      INCPATH = linux-g++-32
      LFLAGS = -m32 -w1, -o1
      LIBS = i386-linux-gnu
      
    • make softlink of

      /usr/lib/i386-GNU-linux/libQtCore.so.4.1
                          libQtGui.....
                          libQtXmlPattern..
                          libQtXml.....
      

      to lib .... .so.o then to lib .... .so make clean and compile