Building applications with different library variants (32 / 64 bit)



  • I want to build 32 and 64 bit applications (on Linux). I've got some 3rd party shared libraries that are available as both, 32 and 64-bit versions.

    What's the best way to include a library, depending whether I'm using 32 or 64 kit? Some magic in *.pro file or something else?



  • take a look here


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    If you take a look @yoavmil link, the correct answer is the one from Nejat where he uses QMAKE_HOST to get the architecture information.

    Also take a look at QMAKE_HOST's documentation. The example there uses an additional scope that you can adapt to your situation.



  • I also came across this post and the SO link before; the same with the QMAKE_HOST documentation. But, I'm a bit confused, I probably must take a step back.

    QMAKE_HOST tells me info about the host / development machine, doesn't it? So, QMAKE_HOST.arch will be the same for that particular machine regardless what the target architecture is, whether it is 32-bit (x86) or 64-bit (x64). Is my reasoning correct?


  • Lifetime Qt Champion

    You right yes. What you would usually do when building for two different architecture of Qt, is use the qmake for that particular version of Qt so this trick works fine.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.