Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

[SOLVED]Configuring Qt for i386 architecture.



  • I am on mac and I am trying to link a library (.dylib) in my own app. The library though was created for i386 architecture and as a result I get the warning

    @file was built for i386 which is not the architecture being linked (x86_64)@

    and the error

    @symbol(s) not found for architecture x86_64@

    How can I configure Qt to build for i386 so I can successfully link the library?

    EDIT
    I have no problem building with qmake if that will help.


  • Moderators

    Please remember Apple is trying to deprecate the i386 architecture, they recommend building everything in the pseudo 64 bit.

    To configure Qt for 32 bit, you need to pass this to configure script:
    @
    configure -arch x86
    @



  • I see, but unfortunately the library was not build by me so there is nothing I can do about that.
    What is the 'configure script'? is it the .pro file?


  • Moderators

    Ah, ok.

    You need to compile Qt source code (the whole Qt framework) in 32 bit. It will not work otherwise. And one of the steps of building Qt is running it's configure script. The whole process is described here: "link":http://qt-project.org/wiki/Building_Qt_5_from_Git.

    Then you can use that version to build your project and link it with a 32 bit library.



  • Got it, thank you.



  • After trying your suggestion I got this message while configuring Qt

    NOTICE: The -arch and -host-arch options are obsolete.

    Qt now detects the target and host architectures based on compiler
    output. Qt will be built using x86_64 for the target architecture
    and x86_64 for the host architecture (note that these two
    will be the same unless you are cross-compiling).

    Would an older version do the trick?



  • Just tried version 4.8 and it is not compatible with my version of OSx, tough luck :)


  • Lifetime Qt Champion

    Hi,

    What version of 4.8 and OS X are you using ? 4.8.6 should be good for both 10.9 and 10.10



  • Well I had 4.8.2 since I could not find the source distribution for any other 4.8.x version and my OS version is 10.9.5. I don't have the exact message I got though, it was something on the lines of Qt is not compatible with my version of OS.


  • Lifetime Qt Champion

    The sources of 4.8.6 can be found "here":http://download.qt-project.org/official_releases/qt/4.8/4.8.6/ or you can also use git and clone the repository



  • I will give this a try as soon as I can, and try to build the 32bit version drivers also, but for now I am struggling with the IBMs' db2 drivers still. Have you read my thread about it, I can't even get them to compile.


Log in to reply