Xcode를 사용하여 C++에서 싱글 톤 클래스를 만들려고합니다. 그것은 정말 기본적인 클래스이고 나는 이해하지 못하는 링커 에러를 얻습니다. any1 도와주세요 수 있습니까? 당신은을 정의 필요Xcode의 싱글 톤
Undefined symbols for architecture x86_64:
"Network::_instance", referenced from:
Network::instance() in Network.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
은 내가 헤더 파일을 가지고 파일을 구현하지 않는 경우이 인스턴스를 선언하는 방법을 궁금해 클래스는 내가 선언을 넣어야 경우, 하나 개의 파일에? – WindMemory
@WindMemory 클래스 선언 외부의 소스 파일에 정의를 넣으십시오. –
감사합니다. – WindMemory