架构x86_64的未定义符号:Eclipse Mac OSX

时间:2015-02-12 15:21:22

标签: c++ eclipse c++11 osx-mavericks eclipse-cdt

我试图在eclipse luna cdt环境中构建我的项目。看来链接器的代码存在问题。我对链接器和编译器完全缺乏经验,并且不知道如何解决问题。我尝试在IDE之外编译代码并遇到类似的问题。以下是Eclipse在尝试构建项目时给出的消息。任何帮助将不胜感激。

17:09:25 **** Build of configuration Debug for project Assignment 1 ****
make all 
Building file: ../linkedList.C
Invoking: GCC C++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"linkedList.d" -MT"linkedList.d" -o "linkedList.o" "../linkedList.C"
Finished building: ../linkedList.C

Building file: ../main.cpp
Invoking: GCC C++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"main.d" -MT"main.d" -o "main.o" "../main.cpp"
Finished building: ../main.cpp

Building target: Assignment 1
Invoking: MacOS X C++ Linker
g++  -o "Assignment 1"  ./linkedList.o ./main.o   
Undefined symbols for architecture x86_64:
  "LinkedList<int>::print(std::__1::basic_ostream<char, std::__1::char_traits<char> >&)", referenced from:
      vtable for LinkedList<int> in main.o
  "std::__1::basic_ostream<char, std::__1::char_traits<char> >& operator<<<int>(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, LinkedList<int>&)", referenced from:
      _main in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Assignment 1] Error 1

17:09:27 Build Finished (took 1s.729ms)

0 个答案:

没有答案