나는이처럼 MFC 확장 DLL에 싱글을 선언싱글 MFC 확장 DLL
//header file: SingleTon.h class AFX_EXT_CLASS CMySingleton { public: static CMySingleton* Instance() { if(!singleton) singleton = new CMySingleton(); return singleton; } int a; // Other non-static member functions private: CMySingleton() {}; // Private constructor CMySingleton(const CMySingleton&); // Prevent copy-construction CMySingleton& operator=(const CMySingleton&); // Prevent assignment virtual ~CMySingleton() {}; static CMySingleton* singleton; }; And in a cpp file I code the following line: CMySingleton* CMySingleton::singleton = NULL;
코드 2 :
CMySingleton *a; a = CMySingleton::Instance();
문제는 때 정규 코드 "코드 2" DLL이 모두 잘 작동하지만 내가 다른 MFC 확장에서 "코드 2"를 코딩 할 때 DLL 오류 제공합니다 모든 dependenci을
unresolved external symbol "private: static class CMySingleton* CMySingleton::singleton" ([email protected]@@[email protected])
내가 제대로 확인을 프로젝트 종속성을 통해
아이디어가 있으십니까?
대단한 답변 !! –