使用g ++在C ++程序中跟踪链接器错误的含义是什么

时间:2014-04-01 02:32:16

标签: c++ gcc linker g++

以下链接器错误消息是什么意思?

我使用以下步骤编译我的项目。但最后我收到链接器错误。

guest-wireless-upc-nat-206-117-88-027:PA4 Rafael$ g++ -c Action.cpp 
guest-wireless-upc-nat-206-117-88-027:PA4 Rafael$ g++ -c Space.cpp 
guest-wireless-upc-nat-206-117-88-027:PA4 Rafael$ g++ -c Player.cpp
guest-wireless-upc-nat-206-117-88-027:PA4 Rafael$ g++ -c Pieces.cpp
guest-wireless-upc-nat-206-117-88-027:PA4 Rafael$ g++ -c GameBoard.cpp 
guest-wireless-upc-nat-206-117-88-027:PA4 Rafael$ g++ -g -Wall -o  game game.cpp        
GameBoard.o Space.o Player.o Pieces.o Action.o

错误:

duplicate symbol _a in: 
     /var/folders/ds/t3m3drzx7yjc78gh8xfyf73r0000gn/T/game-0a62a1.o GameBoard.o
ld: 1 duplicate symbol for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

0 个答案:

没有答案