5

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.

Benyamin Jafari
  • 27,880
  • 26
  • 135
  • 150
Farshid616
  • 1,404
  • 1
  • 14
  • 26
  • I changed linux-g++ to linux-g++-32, and add -m32 option to CFLAGS, CXXFLAGS and LFLAGS in make file but The makefile automatically gets changed with every i386 replaced with x86-64. then i got /usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/QtXmlPatterns.so when searching for -lQtXmlPatterns /usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libQtCore.so when searching for -lQtCore /usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libpthread.so when searching for -lpthread /usr/bin/ld: skipping incompatible – Farshid616 Mar 03 '14 at 08:44
  • 2
    http://stackoverflow.com/questions/1272357 – Michael Tomkins Apr 06 '14 at 22:02

2 Answers2

2

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

Michael Petch
  • 46,082
  • 8
  • 107
  • 198
Farshid616
  • 1,404
  • 1
  • 14
  • 26
0

Use string command to see the values inside the .so file . And check the values

for eg string /opt/lib/libEposCmd.so

XAVIER
  • 1
  • 1