Results 1 to 5 of 5

Thread: Building on MacOSX

  1. #1
    Join Date
    Jan 2012
    Posts
    9
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    1
    Wiki edits
    5

    Default Building 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.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Wiki edits
    17

    Default Re: Building on MacOSX

    You appear to be building against Qt 4.7.4, i.e. you have used that version of qmake to build the Makefile. Clean your project and rerun qmake using the one from Qt 4.8.0 if that is the version you wish to use.

    The actual error messages imply that the executable is being built 64-bit but the Qt 4.7.4 libraries are 32-bit.

  3. #3
    Join Date
    Jan 2012
    Posts
    9
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    1
    Wiki edits
    5

    Default Re: Building on MacOSX

    Thanks for your response. I had tried that earlier, but got the same errors. So, I tried cleaning everything and trying it again, and I still get the same errors. I did notice something interesting though. The link error at the top says that it's linking inside an "i386" directory. XCode is currently set to build the x86_64 architecture. I don't know why there would be any objects in the "i386" folder. Based on the directories and the object-files inside, it looks like it's building all three architectures - i386, ppc, and x86_64.

    i386 errors:

    Link /Users/Brit/Develop/.../src/build/LunarSim.build/Debug/LunarSim.build/Objects-normal/i386/LunarSim
    In /Users/Brit/Develop/Qt-4.8/Desktop/Qt/4.8.0/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/4.8.0/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/4.8.0/gcc/lib/QtOpenGL.framework/phonon, file was built for unsupported file format which is not the architecture being linked (i386)
    ...

    And when I scroll down through the build report I see a similar section, except instead of saying "i386" it says "ppc". Is it normal for XCode to build all architectures at the same time? Is there a way to turn it off? Maybe XCode is building the x86_64 version just fine - but I'm still ending up with a ton of errors from the i386 and ppc architectures.

    ppc errors:

    Link /Users/Brit/Develop/.../src/build/LunarSim.build/Debug/LunarSim.build/Objects-normal/ppc/LunarSim
    In /Users/Brit/Develop/Qt-4.8/Desktop/Qt/4.8.0/gcc/lib/QtWebKit.framework/QtWebKit, file was built for unsupported file format which is not the architecture being linked (ppc)
    In /Users/Brit/Develop/Qt-4.8/Desktop/Qt/4.8.0/gcc/lib/phonon.framework/phonon, file was built for unsupported file format which is not the architecture being linked (ppc)
    In /Users/Brit/Develop/Qt-4.8/Desktop/Qt/4.8.0/gcc/lib/QtOpenGL.framework/phonon, file was built for unsupported file format which is not the architecture being linked (ppc)
    ...

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Wiki edits
    17

    Default Re: Building on MacOSX

    And when I scroll down through the build report I see a similar section, except instead of saying "i386" it says "ppc". Is it normal for XCode to build all architectures at the same time?
    By default it would seem so.

    Is there a way to turn it off? Maybe XCode is building the x86_64 version just fine - but I'm still ending up with a ton of errors from the i386 and ppc architectures.
    I think there's an option like
    Project-> Edit Project Settings-> Build-> Build Active Architecture Only

    I am not a Mac user though.

  5. #5
    Join Date
    Jan 2012
    Posts
    9
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    1
    Wiki edits
    5

    Default Re: Building on MacOSX

    I think I have it figured out now. There was a part of the *.pro file that was adding the other architectures. (Specifically, "CONFIG += x86 ppc".) I removed that line and replaced it with "CONFIG += x86_64" and it isn't trying to build the i386 or ppc architectures.

Similar Threads

  1. MacOSX Bundles
    By pwopwo in forum Qt Programming
    Replies: 0
    Last Post: 24th November 2009, 02:53
  2. Help - QOgreGLWidget in macOSx
    By Machado in forum Qt Programming
    Replies: 0
    Last Post: 1st September 2009, 18:27
  3. qwt designer plugin on MacOSX
    By dup in forum Qwt
    Replies: 2
    Last Post: 28th May 2009, 14:27
  4. qwt DYLD_LIBRARY_PATH on MacOsX
    By dup in forum Qwt
    Replies: 10
    Last Post: 10th January 2009, 01:44
  5. Replies: 0
    Last Post: 29th May 2007, 06:28

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.