Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Building Qt fails for OS X and C++11
Qt 6.11 is out! See what's new in the release blog

Building Qt fails for OS X and C++11

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 2.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mjbshaw
    wrote on last edited by
    #1

    I'm trying to build Qt from source and am invoking configure as follows:

    ./configure -opensource -optimized-qmake -c++11

    This results in an error saying that my compiler (clang) doesn't support C++11. Passing the -v (verbose) option to configure shows the following (trimming the other parts):

    C++11 auto-detection... ()
    clang++ -c -pipe -mmacosx-version-min=10.6 -O2 -std=c++11 -Wall -W -fPIE -I../../../mkspecs/macx-clang -I. -o c++11.o c++11.cpp
    c++11.cpp:50:4: error: "C++11 with clang requires libc++ runtime"

    error "C++11 with clang requires libc++ runtime"

    ^
    1 error generated.
    make: *** [c++11.o] Error 1
    C++11 disabled.
    C++11 support cannot be enabled due to functionality tests!

    clang does indeed support C++11, but there are two problems with this functionality test. First, -stdlib=libc++ must be explicitly stated to link to the right runtime. Second, -mmacosx-version-min should be 10.7, because that's the minimum target version for applications using C++11 (at least as far as the OS X SDK is concerned). As far as I can tell, I can't pass these options through configure, which to me suggests that the test is wrong.

    Is there a problem in the configure/feature detection? Or is there a problem in the way in which I'm invoking configure?

    If you need it, my setup is:

    clang --version
    Apple LLVM version 4.2 (clang-425.0.27) (based on LLVM 3.2svn)
    Target: x86_64-apple-darwin12.3.0
    Thread model: posix

    OS X 10.8.3

    Xcode 4.6.1

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      For the macosx-version-min you can edit the macx-clang mkspec in your sources

      Hope it helps

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved