我想编译一个我发现的c ++源代码。该代码在linux(Qt)上运行良好,但在Mac OS X(10.9.5)上我在QT上有这个错误:
/Users/Anass/test2/segmenter.h:19: erreur : 'unordered_map' file not
found
#include <unordered_map>
^
当我更换
"#include <unordered_map>" by "#include<tr1/unordered_map>"
该行用绿色下划线,错误更改为此行:
/Users/Anass/test2/segmenter.h:21: erreur : 'unordered_set' file not
found
#include <unordered_set>
^
我保留了相同的.pro文件(为linux定义):
QT += core gui opengl
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = Superfacets
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
QMAKE_CXXFLAGS_RELEASE += -fpermissive
QMAKE_CXXFLAGS_DEBUG += -fpermissive
QMAKE_CXXFLAGS += -std=c++0x
QMAKE_CXXFLAGS_RELEASE -= -O2
QMAKE_CXXFLAGS_RELEASE += -O3
SOURCES += main.cpp \
Vertex3D.cpp \
Vertex2D.cpp \
Triangle.cpp \
Timer.cpp \
segmenter.cpp \
Reader.cpp \
normals.cpp \
meshvisualizer.cpp \
Edge.cpp \
dialogs.cpp \
colormapper.cpp
HEADERS += \
Vertex3D.h \
Vertex2D.h \
Triangle.h \
Timer.h \
Sorting.h \
segmenter.h \
Reader.h \
normals.h \
meshvisualizer.h \
Mesh.h \
Edge.h \
dialogs.h \
colormapper.h
LIBS += -lGLU
clang版本是:
clang --version
Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix
我搜索谷歌,我发现它可能与“stdlib”有关,但我真的是编译的专家。
请帮忙吗?
答案 0 :(得分:0)
Google快速透露this fix。添加
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.7
到您的.pro
文件以及前面提到的
QMAKE_CXXFLAGS += -std=c++11