他の人のC++コードをコンパイルしようとしています。私自身、C++の経験はありません。MACでg++を使用して、受け取った.cppファイルの1つをコンパイルしています。するとg++ main.cpp
、未定義のシンボルエラーが発生します。グーグルで答えるのはファイル間のリンクが間違っているようですが、ファイルをリンクする方法がわかりません。ファイルをコンパイルするにはどうすればよいですか?以下に完全なコードを貼り付けました。
Undefined symbols:
"initializeFitness()", referenced from:
runEvolution() in ccZXBTDH.o
"Grid::GetNeighbourhood(int, int, std::vector<Agent**, std::allocator<Agent**> >&)", referenced from:
runEvolution() in ccZXBTDH.o
runEvolution() in ccZXBTDH.o
runEvolution() in ccZXBTDH.o
"Grid::Grid()", referenced from:
runEvolution() in ccZXBTDH.o
"Reaper::GetAgentToKill()", referenced from:
runEvolution() in ccZXBTDH.o
"Cupid::GetRandomBreeder()", referenced from:
runEvolution() in ccZXBTDH.o
"Reaper::Select()", referenced from:
runEvolution() in ccZXBTDH.o
"Grid::~Grid()", referenced from:
runEvolution() in ccZXBTDH.o
runEvolution() in ccZXBTDH.o
"Breeder::Breed(Agent**, Agent**)", referenced from:
runEvolution() in ccZXBTDH.o
"Cupid::Select()", referenced from:
runEvolution() in ccZXBTDH.o
"Cupid::GetEmptyCell()", referenced from:
runEvolution() in ccZXBTDH.o
"Agent::GetType()", referenced from:
runEvolution() in ccZXBTDH.o
runEvolution() in ccZXBTDH.o
runEvolution() in ccZXBTDH.o
runEvolution() in ccZXBTDH.o
"Breeder::ProcessNeighbourhood(std::vector<Agent**, std::allocator<Agent**> > const&)", referenced from:
runEvolution() in ccZXBTDH.o
"FateAgent::GetGenome(double*)", referenced from:
runEvolution() in ccZXBTDH.o
runEvolution() in ccZXBTDH.o
"Cupid::GetParents()", referenced from:
runEvolution() in ccZXBTDH.o
"Agent::IncreaseAge()", referenced from:
runEvolution() in ccZXBTDH.o
"Grid::GetAgent(int, int)", referenced from:
runEvolution() in ccZXBTDH.o
runEvolution() in ccZXBTDH.o
runEvolution() in ccZXBTDH.o
runEvolution() in ccZXBTDH.o
runEvolution() in ccZXBTDH.o
runEvolution() in ccZXBTDH.o
runEvolution() in ccZXBTDH.o
runEvolution() in ccZXBTDH.o
runEvolution() in ccZXBTDH.o
runEvolution() in ccZXBTDH.o
runEvolution() in ccZXBTDH.o
runEvolution() in ccZXBTDH.o
runEvolution() in ccZXBTDH.o
runEvolution() in ccZXBTDH.o
runEvolution() in ccZXBTDH.o
runEvolution() in ccZXBTDH.o
"FateAgent::GetSelectedCount()", referenced from:
runEvolution() in ccZXBTDH.o
runEvolution() in ccZXBTDH.o
"Breeder::GetGenome(double*)", referenced from:
runEvolution() in ccZXBTDH.o
"Agent::GetFitness()", referenced from:
runEvolution() in ccZXBTDH.o
runEvolution() in ccZXBTDH.o
runEvolution() in ccZXBTDH.o
"Agent::~Agent()", referenced from:
runEvolution() in ccZXBTDH.o
"Grid::DoMovement()", referenced from:
runEvolution() in ccZXBTDH.o
ld: symbol(s) not found
collect2: ld returned 1 exit status