在eclipse

时间:2015-11-20 10:06:21

标签: c++ linux eclipse googletest

我试图在我的cpp项目中使用gtest,并且可能存在链接错误。 它也无法识别测试文件夹中的主要内容。

Building target: MovieSystem
Invoking: Cross G++ Linker
g++  -o "MovieSystem"  ./src/Actor.o ./src/Director.o ./src/Menu.o ./src/Movie.o ./src/Producer.o ./src/Professional.o ./src/ScreenWriter.o ./src/System.o ./src/factorial.o   -lpthread

/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 0 has invalid symbol index 11
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 1 has invalid symbol index 12
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 2 has invalid symbol index 2
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 3 has invalid symbol index 2
...
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_line): relocation 0 has invalid symbol index 2
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crt1.o: In function `_start':

(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status
make: *** [MovieSystem] Error 1

请注意,我完全按照这里的说明操作: http://www.codeproject.com/Articles/811934/Cplusplus-unit-test-start-guide-how-to-set-up-Goog

那我做错了什么? 谢谢!

0 个答案:

没有答案