내가 통과 벡터의 주소는 다음 구문을 사용하여이 :정의되지 않은 심볼 : C++ OS X 벡터
void myfunction(std::vector<double>*);
int main()
{
std::vector<double> t;
myfunction(&t);
return 0;
}
void myfunction(std::vector<double> &v)
{
cout << "The function ran" <<endl;
}
이 오류를 받고 난 이유를 모르겠어.
pal-nat184-134-146:p25 pdevieti$ g++-4.9 test.cpp
Undefined symbols for architecture x86_64:
"myfunction(std::vector<double, std::allocator<double> >*)", referenced from:
_main in ccVmpacj.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
'myfunction' 선언이 정의와 일치하지 않습니다. – juanchopanza
'myfunction'의 선언에서 인수는 double 타입의 벡터에 대한 포인터입니다. 정의에서 동일한 종류의 벡터에 대한 참조를 취합니다. – adam10603
링커 오류가 발생했기 때문에 OS와 컴파일러를 다시 설치 했습니까? ?! – Praetorian