You are not logged in.

#1 2012-01-12 08:34:16

Si
Member
Registered: 2006-09-11
Posts: 57

The appropriate way to create a lib32 Qt plugin?

I've just learned that compiling a Qt pluging in x86_64 Arch Linux is tricky. First, Qt checks the BUILD_KEY of the plugin. More specifically, the architecture specified in BUILD_KEY has to match the BUILD_KEY of Qt. For example, a plugin with a BUILD_KEY "i386 linux g++-4 full-config" will not work with Qt compiled with a BUILD_KEY "x86_64 linux g++-4 full-config".

This is problematic, because BUILD_KEY is defined in /usr/include/QtCore/qconfig.h. Since the x86_64 qt package defines BUILD_KEY as x86_64, any lib32 plugin compiled under the x86_64 Arch Linux will use the wrong BUILD_KEY, so it won't work. What's tricky is lib32-qt contains only .so files, header files are not included, so you can't cross compile lib32 packages using the i686 qt header files. So here are some of the ideas I currently have to deal with such scenario:

- Create a lib32-qt that contains everything the i686 qt package contains, except that /usr/lib becomes /usr/lib32. Then temporarily replace x86_64 qt with this lib32-qt package, compile the package, then revert the change. A bit cumbersome just to compile a plugin.
- Alternatively, install x86_64 Arch Linux on another partition/hard drive/chroot, install the lib32-qt mentioned above, and purely use this environment to compile lib32 qt plugins. It's very wasteful in terms of disk space.
- Or, create a lib32-qt-dev package that contains /usr/lib32, /usr/include32 and /usr/lib/pkgconfig32. Compiling packages with such a setup will probably be a nightmare.
- Other ideas?

So what would be the most appropriate way to go about compiling a lib32 Qt plugin? Thanks in advance for any input.

Offline

#2 2012-05-22 14:55:12

travnick
Member
From: Poland
Registered: 2011-04-24
Posts: 59

Re: The appropriate way to create a lib32 Qt plugin?

Don't know if it solves your issue, but I had problem with loading Qt plugin at runtime:

uses incompatible Qt library. Expected build key "i386 linux g++-4 full-config", got "x86_64 linux g++-4 full-config"" 

The solution for me is to install 32-bit QtSDK, and add (for example):

~/QtSDK/Desktop/Qt/4.8.1/gcc/bin/ 

to the beggining of yout PATH

Offline

Board footer

Powered by FluxBB