Compiling on MacOSX



  • I'm having trouble building a QT application on Mac OSX.

    When I compile my application, I get down to the linking section and get a bunch of errors. I tried looking up similar errors online, and it looks like a mismatch between the platform I'm building for and the platform the libraries were compiled on. Unfortunately, I don't know how to fix it. I tried compiling the application for different platforms (i386, ppc, x86_64) using both Debug and Release configurations, but it doesn't seem to make any difference. Do I need to link to something other than the frameworks? I get errors for every Qt framework that I'm linking to.

    My system: Running Mac OSX 10.6.8, Intel Core Duo (64-bit processor), XCode 3.2.4. I'm running the most recent version of Qt - i.e. 4.8 (downloaded it this week)

    The errors involve linking to the frameworks -
    Link ...
    In /Users/Brit/Develop/Qt-4.8/Desktop/Qt/474/gcc/lib/QtNetwork.framework/QtNetwork, file was built for unsupported file format which is not the architecture being linked (i386)
    In /Users/Brit/Develop/Qt-4.8/Desktop/Qt/474/gcc/lib/QtWebKit.framework/QtWebKit, file was built for unsupported file format which is not the architecture being linked (i386)
    In /Users/Brit/Develop/Qt-4.8/Desktop/Qt/474/gcc/lib/phonon.framework/phonon, file was built for unsupported file format which is not the architecture being linked (i386)
    In /Users/Brit/Develop/Qt-4.8/Desktop/Qt/474/gcc/lib/QtXml.framework/QtXml, file was built for unsupported file format which is not the architecture being linked (i386)
    In /Users/Brit/Develop/Qt-4.8/Desktop/Qt/474/gcc/lib/QtOpenGL.framework/QtOpenGL, file was built for unsupported file format which is not the architecture being linked (i386)
    In /Users/Brit/Develop/Qt-4.8/Desktop/Qt/474/gcc/lib/QtGui.framework/QtGui, file was built for unsupported file format which is not the architecture being linked (i386)
    In /Users/Brit/Develop/Qt-4.8/Desktop/Qt/474/gcc/lib/QtCore.framework/QtCore, file was built for unsupported file format which is not the architecture being linked (i386)

    I've also tried using the frameworks in:
    "/Users/Brit/Develop/Qt-4.8/Desktop/Qt/4.8.0/gcc/lib/" instead of
    "/Users/Brit/Develop/Qt-4.8/Desktop/Qt/474/gcc/lib/"

    A few places said that they could solve a similar linking problem (with libs) by rebuilding them, though that seems like a lot of work, and I don't know why this shouldn't work out of the box since I'm not doing anything too complicated.



  • I think I have it figured out. My *.pro file included a section to build the i386, ppc, and x86_64 architectures when I only wanted the x86_64 architecture built.

    I fixed this by replacing "CONFIG += x86 ppc" with "CONFIG += x86_64" in the *.pro file, which is used to create the xcodeproj file.


Log in to reply
 

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