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. [SOLVED] Can't Find C++ include file(s) when building project in 5.2 on Mac
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Can't Find C++ include file(s) when building project in 5.2 on Mac

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 3.7k 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.
  • E Offline
    E Offline
    EricRFMA
    wrote on last edited by
    #1

    Hello...

    I have a project that was building fine in Qt 5.1, but is having trouble in 5.2. I'm on Mac OS 10.8.5, Xcode 5.0.2, Qt Creator 3.0.0 (Based on Qt 5.2.0), and Qt 5.2.0.

    When I try to build, I get this:

    @In file included from ../PopUpper/main.cpp:6:
    ../PopUpper/utilities.h:3:10: fatal error: 'random' file not found
    #include <random>
    ^
    1 error generated.@

    The compile line looks like this:
    @/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -g -gdwarf-2 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -mmacosx-version-min=10.8 -Wall -W -fPIE -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../Qt5.2.0/5.2.0/clang_64/mkspecs/macx-clang -I../PopUpper -I../../Qt5.2.0/5.2.0/clang_64/lib/QtWidgets.framework/Versions/5/Headers -I../../Qt5.2.0/5.2.0/clang_64/lib/QtGui.framework/Versions/5/Headers -I../../Qt5.2.0/5.2.0/clang_64/lib/QtCore.framework/Versions/5/Headers -I. -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/AGL.framework/Headers -I. -I. -F/Projects/Qt5.2.0/5.2.0/clang_64/lib -o main.o ../PopUpper/main.cpp@

    To make it a little clearer, here are the include-related options:
    @-isysroot
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk
    -mmacosx-version-min=10.8
    -I../../Qt5.2.0/5.2.0/clang_64/mkspecs/macx-clang
    -I../PopUpper
    -I../../Qt5.2.0/5.2.0/clang_64/lib/QtWidgets.framework/Versions/5/Headers
    -I../../Qt5.2.0/5.2.0/clang_64/lib/QtGui.framework/Versions/5/Headers
    -I../../Qt5.2.0/5.2.0/clang_64/lib/QtCore.framework/Versions/5/Headers
    -I.
    -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers
    -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/AGL.framework/Headers
    -I.
    -I.
    @

    It looks like the only include path where the relevant include files could be found would be in the <code>-isysroot</code> path. It is on that path at <code>/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/c++/4.2.1/tr1/random</code>.

    For some reason, <code>clang</code> isn't finding it there. The <code>clang</code> version is <code>Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)</code>

    If I use the <code>-v</code> flag on the compile, I see, among other things, the following:
    @#include "..." search starts here:
    #include <...> search starts here:
    ../../Qt5.2.0/5.2.0/clang_64/mkspecs/macx-clang
    ../PopUpper
    ../../Qt5.2.0/5.2.0/clang_64/lib/QtWidgets.framework/Versions/5/Headers
    ../../Qt5.2.0/5.2.0/clang_64/lib/QtGui.framework/Versions/5/Headers
    ../../Qt5.2.0/5.2.0/clang_64/lib/QtCore.framework/Versions/5/Headers
    .
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/AGL.framework/Headers
    /Projects/Qt5.2.0/5.2.0/clang_64/lib (framework directory)
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/c++/4.2.1
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/c++/4.2.1/backward
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/5.0/include
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks (framework directory)
    End of search list.@

    The actual include directory isn't listed.

    At this point, I'm at a loss. I could hard-code a path in my <code>.pro</code> file, but that seems like overkill. I'd think qmake would take care of this. It probably <code>is</code> for most people, and I'm hoping someone might venture a guess (or two) as to what's going on.

    I recently reinstalled Xcode 5.0.2 (from the App Store) and Qt 5.2 (from <code>qt-mac-opensource-5.2.0-clang-offline.dmg</code>)

    Can anyone advise...? Thanks!

    -Eric

    1 Reply Last reply
    0
    • E Offline
      E Offline
      EricRFMA
      wrote on last edited by
      #2

      To answer my own question...

      A little more research revealed that the <code>tr1</code> directory is a pre C++11 place to put test include files. In C++11, it's in the main include directory. In Qt 5.1.0 I had specifically put <code>CONFIG+=c++11</code> in the project definition. I added that to my Qt 5.2.0 project definition, and all is well.

      whew

      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