我有一个makefile,可以用g ++ 4.6编译我的项目。在Makefile中使用Clang ++代替G ++
#specify the compiler
GXX=g++ -std=c++0x
# Specifiy the target
all: linkedList
# Specify the object files that the target depends on
# Also specify the object files needed to create the executable
linkedList: StudentRecord.o Node.o LinkedList.o ListMain.o
$(GXX) StudentRecord.o Node.o LinkedList.o ListMain.o -o linkedList
# Specify how the object files should be created from source files
LinkedList.o: LinkedList.cpp
$(GXX) -c LinkedList.cpp
ListMain.o: ListMain.cpp
$(GXX) -c ListMain.cpp
StudentRecord.o: StudentRecord.cpp
$(GXX) -c StudentRecord.cpp
Node.o: Node.cpp
$(GXX) -c Node.cpp
当我改变的第一行是GXX = clang++ -std=c++0x
铛抛出一些比较密集的错误有关的iostream没有找到正确的ARGS或用东西后,许多其他错误(但这是“根”的错误)一起。
In file included from /usr/include/c++/4.6/iostream:39:
In file included from /usr/include/c++/4.6/ostream:39:
In file included from /usr/include/c++/4.6/ios:40:
In file included from /usr/include/c++/4.6/bits/char_traits.h:40:
In file included from /usr/include/c++/4.6/bits/stl_algobase.h:65:
In file included from /usr/include/c++/4.6/bits/stl_pair.h:60:
In file included from /usr/include/c++/4.6/bits/move.h:53:
/usr/include/c++/4.6/type_traits:630:59: error: '_Tp' does not refer to a value
: public integral_constant<bool, __is_standard_layout(_Tp)>
这是我的生成文件的问题,还是真的可以在这个简单的编译区别?
使用铛2.9。
注:那铿锵抱怨该生产线是#include <iostream>
我不是一个C++高手,但[此页](http://clang.llvm.org/cxx_status.html)似乎表明,铛2.9不100%准备好C++ 0x - 也许这是问题的一部分? – 2012-03-16 06:11:29
它没有在C++ 0x问题上崩溃,它在包含iostream时崩溃我认为 – soandos 2012-03-16 06:11:58
错误消息中的路径看起来像你得到g ++ 4.6的头文件而不是clang的头文件。 g ++头文件倾向于使用gcc特定的扩展名和可能不适用于clang的东西。 – 2012-03-16 06:28:13