2012-09-27 95 views
0

Possible Duplicate:
What is an undefined reference/unresolved external symbol error and how do I fix it?傳遞動態數組的功能

我傳遞一個整數的動態數組的功能,我無法得到它的工作。

int * tempP1; 

tempP1 = new int [numP1+1]; 

電話:

Polynomial P1(numP1, tempP1); 

原型:

Polynomial(int tempNum, int * tempPoly); 

功能:

Polynomial::Polynomial(tempNum, int *tempPoly) 

錯誤:

Undefined symbols for architecture x86_64: 
    "Polynomial::Polynomial(int, int*)", referenced from: 
    _main in ccDOuaGg.o 
    "Polynomial::~Polynomial()", referenced from: 
    _main in ccDOuaGg.o 
ld: symbol(s) not found for architecture x86_64 
collect2: ld returned 1 exit status 

任何幫助將不勝感激:)

+0

巴阿,它與陣列的問題,而不是用的外部@Luchian –

+1

@BartekBanachewicz什麼陣列?問題在於構造函數/析構函數沒有實現。 –

+1

在「Polynomial」構造函數的定義中,您缺少第一個參數的類型,複製粘貼錯誤? –

回答

0

我想出了問題。我錯誤地編譯了這個程序。