Important: Please read the Qt Code of Conduct -

Build 32bit-only with qt 4.8.1 and xcode-4.3.2

  • I have a project that won't build for x86_64. The reason is that the code casts pointers to 32bit integers, which works in 32bit mode but not in 64bit mode, so I get the error "uint32 loses precision", so I am limited to compile in 32bit only, as I can't patch the code.

    My build system is osx 10.7 (lion), with xcode 4.3.2, and qt-4.8.1 built from source with arches i386 and x86_64.

    No matter how I modify my project file, after running: qmake *.pro, the resulting Makefile contains the bad words: -arch x86_64 -Xarch_x86_64

    I have tried the following:

    QT += network
    QT -= gui
    CONFIG += release thread static rtti link_prl
    macx {
    CONFIG -= x86_64 ppc64
    CONFIG += x86
    ARCHES -= x86_64
    ARCHES += i386
    LIBS += -framework CoreFoundation
    DESTDIR = ../../../MY/ProgramFiles/

    I have used lipo -arch <qt archive paths> to verify they contain i386 and x86_64

    [EDIT: code formatting, please wrap in @-tags, Volker]

  • Moderators

    Have you tried compiling Qt with -arch x86 only? I did that and get clean 32 bit builds.

  • I tried compiling Qt with -arch x86 only. That worked. I used the resulting qt to build a project with ARCH i386. But I was not able to run the resulting APP on lion. I haven't figured that out yet. But my initial question still stands, What do I feed a .pro, for: qmake to create a Makefile that only builds i386 targets.

Log in to reply