Quantcast
Channel: Qt DevNet forums: Installation and Deployment
Viewing all articles
Browse latest Browse all 2113

C++11 in Qt5 / QtCreator 3.0.1 on OSX

$
0
0
Just downloaded and installed Qt5 on OSX 10.9.2. When trying to compile some C++11 code using the clang run kit, I get a failure when I try to include cstdint; fatal error: 'cstdint' file not found After a lot of googling, it seems that c++11 is not ‘enabled’ by default which triggers this error. It further seems that the way to enable c++11 has changed in Qt5. It should be as simple as adding CONFIG+=c++11 in “Projects -> Build & Run -> Build Steps -> Additional arguments” if I understand it correctly. However this makes no difference whatsoever. I have also tried adding the following lines to the .pro file (both with and without the above c++11 config thing); QMAKE_CXXFLAGS += -std=c++11 -stdlib=libc++ -mmacosx-version-min=10.7 LIBS += -stdlib=libc++ -mmacosx-version-min=10.7 No effect. So; anyone knows how to enable c++11 using QtCreator with the clang kit? About QtCreator gives me the following information: QtCreator 3.0.1 Based on Qt 5.2.1 (Clang 5.0 (Apple), 64 bit) The compiler output, as seen in QtCreator’s “Compile Output”, is as follows: 14:25:23: Running steps for project shelly... 14:25:23: Starting: "/Users/m/Qt5.2.1/5.2.1/clang_64/bin/qmake" /Volumes/files/Programmering/shelly/shelly.pro -r -spec macx-clang CONFIG+=debug CONFIG+=x86_64 CONFIG+=declarative_debug CONFIG+=qml_debug CONFIG+=c++11 14:25:23: The process "/Users/m/Qt5.2.1/5.2.1/clang_64/bin/qmake" exited normally. 14:25:23: Starting: "/usr/bin/make" /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.7 -Wall -W -fPIE -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/Users/m/Qt5.2.1/5.2.1/clang_64/mkspecs/macx-clang -I../shelly -I/Users/m/Qt5.2.1/5.2.1/clang_64/lib/QtOpenGL.framework/Versions/5/Headers -I/Users/m/Qt5.2.1/5.2.1/clang_64/lib/QtWidgets.framework/Versions/5/Headers -I/Users/m/Qt5.2.1/5.2.1/clang_64/lib/QtGui.framework/Versions/5/Headers -I/Users/m/Qt5.2.1/5.2.1/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/Users/m/Qt5.2.1/5.2.1/clang_64/lib -o datainterval.o ../shelly/core/datainterval.c++ In file included from ../shelly/core/datainterval.c++:5: In file included from ../shelly/core/datainterval.h++:9: ../shelly/core/datatime.h++:9:10: fatal error: 'cstdint' file not found #include <cstdint> // GPL w/runtime exception          ^ 1 error generated. make: *** [datainterval.o] Error 1 14:25:24: The process "/usr/bin/make" exited with code 2. Error while building/deploying project shelly (kit: Desktop Qt 5.2.1 clang 64bit) When executing step 'Make' 14:25:24: Elapsed time: 00:01.

Viewing all articles
Browse latest Browse all 2113

Trending Articles