Qt4 How to build 32-bit application on OpenSuse 11.4 x86_64?

Hello.
I’m trying to build 32-bit Qt4 application on 64-bit system. I have installed Qt-Creator and in build option I set parameter

-spec linux-g++-32

But still, linker is linking 64bit instead of 32-bit library. Of course compiler is returning error:

/usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib64/libQtSql.so when searching for -lQtSql
/usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../libQtSql.so when searching for -lQtSql
/usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib64/libQtGui.so when searching for -lQtGui
/usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../libQtGui.so when searching for -lQtGui
/usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib64/libQtCore.so when searching for -lQtCore
/usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../libQtCore.so when searching for -lQtCore

How to build 32-bit application? Am I missing something on my system?

This is list of qt4 related library in my system:

libqt4-sql-mysql-4.7.1-7.2.x86_64
libqt4-devel-doc-data-4.7.1-7.1.noarch
kdevelop4-pg-qt-devel-0.9.0-3.1.x86_64
mono-qt-4.6.0-3.4.x86_64
libqt4-sql-32bit-4.7.1-7.1.x86_64
yast2-qt-pkg-2.20.3-3.1.x86_64
vlc-qt-1.1.8-1.pm.2.4.x86_64
libqt4-4.7.1-7.1.x86_64
libqt4-sql-mysql-32bit-4.7.1-7.2.x86_64
qtcurve-gtk2-32bit-1.8.1-3.1.x86_64
yast2-qt-2.20.4-1.2.1.x86_64
libqt4-devel-doc-4.7.1-7.3.x86_64
mono-qt-devel-4.6.0-3.4.x86_64
qt4-x11-tools-4.7.1-7.3.x86_64
libqt4-devel-4.7.1-7.1.x86_64
libqt4-sql-4.7.1-7.1.x86_64
libqt4-sql-sqlite-4.7.1-7.1.x86_64
libpackagekit-qt14-0.6.12-1.4.1.x86_64
python-qt4-4.8.3-3.2.x86_64
yast2-qt-graph-2.19.0-4.1.x86_64
qt-creator-2.1.0-1.3.1.x86_64
libqt4-qt3support-32bit-4.7.1-7.1.x86_64
libqt4-x11-4.7.1-7.1.x86_64
libpoppler-qt4-3-0.14.4-6.1.x86_64
libdbusmenu-qt2-0.6.6-3.1.x86_64
yast2-control-center-qt-2.20.2-1.3.1.x86_64
libqt4-x11-32bit-4.7.1-7.1.x86_64
qtcurve-gtk2-1.8.1-3.1.x86_64
kdevelop4-pg-qt-0.9.0-3.1.x86_64
qt4-qtscript-0.1.0-10.1.x86_64
libqt4-sql-unixODBC-4.7.1-7.2.x86_64
libqt4-sql-sqlite-32bit-4.7.1-7.1.x86_64
libqt4-32bit-4.7.1-7.1.x86_64
libpolkit-qt-1-1-0.99.1-5.1.x86_64
qt4-qtscript-doc-0.1.0-10.1.x86_64
libqt4-sql-unixODBC-32bit-4.7.1-7.2.x86_64
patterns-openSUSE-devel_qt4-11.4-6.9.1.x86_64
libqt4-qt3support-4.7.1-7.1.x86_64
pinentry-qt4-0.8.0-8.1.x86_64

I would suggest that the linker is searching the 64-bit library directory. This can be specified with the -L gcc option (although I would have thought your -spec might have taken care of it).

If you can set gcc-specific options then I suggest you try adding -L /usr/lib

Regards,
Neil Darlow

Hi,

I should also add that you will require the 32-bit versions of the libraries you require to be installed in order to successfully link your application.

Regards,
Neil Darlow

Thanx for reply.
I had specified library folder by adding link: unix::LIBS += -L/usr/lib/
Still the same issue. Whas is name of package I should install to have 32-bit libraries?

It is all about linker. I’m defining library folder -L/usr/lib. Linker is still linking libraries from /usr/lib64. Any sugestions?

Hi,

I would suggest separating -L from /usr/lib with a space. I know it is not required for -l but I am not sure about -L.

The 32-bit versions of libraries are packaged with -32bit in their name. Search for that in YaST2 to locate available libraries.

Regards,
Neil Darlow

porterneon wrote:

>
> It is all about linker. I’m defining library folder -L/usr/lib. Linker
> is still linking libraries from /usr/lib64. Any sugestions?
>
>
At least (looking at your linker outut) you will need the packages

libqt4-sql-32bit
libqt4-x11.32bit
libqt4-32bit

Install them with yast.


PC: oS 11.3 64 bit | Intel Core2 Quad Q8300@2.50GHz | KDE 4.6.1 | GeForce
9600 GT | 4GB Ram
Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | Gnome 2.32 | nVidia
ION | 3GB Ram

Those packages are already installed. On second computer, with fedora 14 everything is working correct. So it’s must be some configuration issue. But what can it be?

Just make your application and RPM spec file. Register to openSUSE build service and upload app there. If everything goes right, you will have both 32 and 64 bit application built for myriad of RPM distros.