我在MAC OS X上的Eclipse中有一個持久的未定義符號錯誤。我無法確定錯誤的來源爲 。持久未定義的引用
int Application::execute_Algorithm()
{
if (this->GA_On)
{
GA_Operations *gaAlgorithm = new GA_Operations();
gaAlgorithm->run_algorithm(blocksSequence, bins);
}
else
{
packingAlgorithm->run_algorithm(blocksSequence, bins); return 0;
} //
return 0;
}
誤差表示爲:: Undefined symbols for architecture x86_64: "binproject::GA_Operations::run_algorithm(binproject::Blocks_Sequence&, binproject::BinContainer&)", referenced from: binproject::Application::execute_Algorithm() in Application.o "binproject::GA_Operations::GA_Operations()", referenced from: binproject::Application::execute_Algorithm() in Application.o
而聲明
根據編譯器時我嘗試使用GA_Operations和gaAlgorithm-> run_algorithm .....下方會出現錯誤是:
class GA_Operations {
public:
GA_Operations();
~GA_Operations();
//call from main application to execute algorithm
void run_algorithm(Blocks_Sequence &b_seq, BinContainer &container);
...
};
它也會引發類似的錯誤只要我嘗試在定義一個函數聲明執行(CPP)文件。
任何想法?這似乎只發生在這個班上。
另外,我很抱歉,如果有一個與代碼縮進一個問題,我
讓我們看看你是如何「在實現中定義一個聲明的函數(CPP)file_」 – Foggzie
run_algorithm定義在哪裏? – Goz