C++을 배우고 있으며 Date에 값을 설정하려고하는 간단한 Date 클래스가 있습니다. 내가 코드를 컴파일 할 때 그러나, 나는 오류 메시지가 Date.hC++ 오류 - 아키텍처 x86_64에 대한 정의되지 않은 기호 :
class Date{
private:
int month;
int day;
int year;
public:
Date();
void setDate(int m, int d, int y);
};
및 Date.cpp
#include "Date.h"
Date::Date()
{
month = 1;
day = 1;
year = 80;
};
void Date :: setDate(int m1, int d1, int y1){
month = m1;
day = d1;
year = y1;
};
-
다음은 소스 코드 파일입니다 -
Undefined symbols for architecture x86_64:
"_main", referenced from:
start in crt1.10.6.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
누군가 제발 도와 줄 수 있습니까?
감사합니다.