kyb
kyb

Reputation: 8211

How to tell QtCreator and QMake where to find Qt libraries x86 32bit

I have a Qt-based project which is perfectly compiled and run under Ubuntu 16 LTS x64.
Currently I need to build and run it for x86 32bit machine on current machine.

Qt was built for x86 with usual command sequence (paths are not exactly the same):

mkdir ~/qt-build  &&  cd ~/qt-build
/opt/Qt5.9.1/Src/configure -platform linux-g++-32
qmake
make -j4
make install

Make installed x86 libraries to usr/local/Qt-5.9.1.

In QtCreator I also created yet another build specification named Debug-32 with qmake Additional agruments: -spec linux-g++-32.

But that's not enough. I need to tell QtCreator where x86 libraries are located. I expect to set some additional variable to QMake. Please help. Thank you in advance.

Upvotes: 0

Views: 1667

Answers (1)

Felix
Felix

Reputation: 7146

If I understand your problem correctly, you are using the "old" qmake you also used for the x86 build, but pass the 32 spec to it?

If thats the case: This is not how it works. What you actually need to do is to add your compiled Qt as a new Kit to QtCreator. This is done in a few steps.

  1. Got to "Setting -> Build & Run -> Qt Versions"
  2. The, click "Add" and add the path to the newly compiled x86 qmake binary (should be something like /usr/local/Qt-5.9.1/bin/qmake
  3. Go to the "Kits" Tab, and select the x64 kit you used before, and press "clone"
  4. Select the new kit, adjust the following parameters:
    1. The Kit name (simply remove the "clone of" and change the 64bit to 32bit - but you can choose whatever you want)
    2. The Qt Version (You will be able to select your newly added qmake from a combobox)
    3. The C and C++ compilers. Make shure to select the x86 versions of your compilers

Once that has been done, you can go to the "Projects" tab in the QtCreator main window and add your new kit for you project. Select it for building, and it should use the correct libraries etc.

Upvotes: 1

Related Questions