Visual C++ 응용 프로그램에서 기존 클래스를 수정하여 제네릭 클래스로 만들었습니다. 이 클래스는 두 개의 다른 모듈에서 사용됩니다. 이 모듈을 따로 컴파일하면 모든 것이 작동합니다. 그러나 Build All을 수행하면 다음과 같은 링커 오류가 발생합니다.C++ 일반 클래스 링크 오류
1>Linking...
1> Creating library C:\ccmdb\prep\g3_v5.3\g3_tools\fc_tools\ZFRTool\ZStackMTI\Debug\ZStackMTI.lib and object C:\ccmdb\prep\g3_v5.3\g3_tools\fc_tools\ZFRTool\ZStackMTI\Debug\ZStackMTI.exp
1>SerialPort.obj : error LNK2019: unresolved external symbol "public: __thiscall CRingBuffer<unsigned char>::CRingBuffer<unsigned char>(unsigned long)" ([email protected]@@[email protected]@Z) referenced in function "public: __thiscall CSerialPort::CSerialPort(void)" ([email protected]@[email protected])
1>ZStackMTI.obj : error LNK2001: unresolved external symbol "public: __thiscall CRingBuffer<unsigned char>::CRingBuffer<unsigned char>(unsigned long)" ([email protected]@@[email protected]@Z)
1>SerialPort.obj : error LNK2019: unresolved external symbol "public: __thiscall CRingBuffer<unsigned char>::~CRingBuffer<unsigned char>(void)" ([email protected]@@[email protected]) referenced in function "public: void * __thiscall CRingBuffer<unsigned char>::`scalar deleting destructor'(unsigned int)" ([email protected]@@[email protected])
1>ZStackMTI.obj : error LNK2001: unresolved external symbol "public: __thiscall CRingBuffer<unsigned char>::~CRingBuffer<unsigned char>(void)" ([email protected]@@[email protected])
1>SerialPort.obj : error LNK2019: unresolved external symbol "public: unsigned long __thiscall CRingBuffer<unsigned char>::GetBufferItems(void)" ([email protected][email protected]@@QAEKXZ) referenced in function "public: unsigned long __thiscall CSerialPort::GetBufferedRxItems(void)" ([email protected]@@QAEKXZ)
1>SerialPort.obj : error LNK2019: unresolved external symbol "public: int __thiscall CRingBuffer<unsigned char>::Peek(unsigned char *,unsigned long,unsigned long *)" ([email protected][email protected]@@[email protected]) referenced in function "public: unsigned long __thiscall CSerialPort::Peek(unsigned char *,unsigned long,unsigned long *)" ([email protected]@@[email protected])
1>SerialPort.obj : error LNK2019: unresolved external symbol "public: int __thiscall CRingBuffer<unsigned char>::Remove(unsigned char *,unsigned long,unsigned long *)" ([email protected][email protected]@@[email protected]) referenced in function "public: unsigned long __thiscall CSerialPort::Read(unsigned char *,unsigned long,unsigned long *)" ([email protected]@@[email protected])
1>ZStackMTI.obj : error LNK2001: unresolved external symbol "public: int __thiscall CRingBuffer<unsigned char>::Remove(unsigned char *,unsigned long,unsigned long *)" ([email protected][email protected]@@[email protected])
1>SerialPort.obj : error LNK2019: unresolved external symbol "public: int __thiscall CRingBuffer<unsigned char>::Add(unsigned char *,unsigned long,int)" ([email protected][email protected]@@[email protected]) referenced in function "public: unsigned long __thiscall CSerialPort::Write(unsigned char *,unsigned long)" ([email protected]@@[email protected])
1>ZStackMTI.obj : error LNK2001: unresolved external symbol "public: int __thiscall CRingBuffer<unsigned char>::Add(unsigned char *,unsigned long,int)" ([email protected][email protected]@@[email protected])
1>SerialPort.obj : error LNK2019: unresolved external symbol "public: int __thiscall CRingBuffer<unsigned char>::Delete(unsigned long)" ([email protected][email protected]@@[email protected]) referenced in function "public: unsigned long __thiscall CSerialPort::Delete(unsigned long,int)" ([email protected]@@[email protected])
1>SerialPort.obj : error LNK2019: unresolved external symbol "public: int __thiscall CRingBuffer<unsigned char>::Flush(void)" ([email protected][email protected]@@QAEHXZ) referenced in function "public: unsigned long __thiscall CSerialPort::Flush(int)" ([email protected]@@[email protected])
1>ZStackMTI.obj : error LNK2019: unresolved external symbol "public: unsigned char __thiscall CRingBuffer<unsigned char>::Peek(unsigned long)" ([email protected][email protected]@@[email protected]) referenced in function "unsigned long __cdecl ZBNConnect_GetExtAddr(unsigned char *)" ([email protected]@[email protected])
1>C:\ccmdb\prep\g3_v5.3\g3_tools\fc_tools\ZFRTool\ZStackMTI\Debug\ZStackMTI.dll : fatal error LNK1120: 9 unresolved externals
1>Build log was saved at "file://c:\ccmdb\prep\g3_v5.3\g3_tools\fc_tools\ZFRTool\ZStackMTI\ZStackMTI\Debug\BuildLog.htm"
1>ZStackMTI - 14 error(s), 0 warning(s)
Visual Studio 2008을 사용하고 있습니다.이 문제를 해결하는 방법을 알고 있습니까? 수정 이전에는 모든 것이 아무런 문제없이 구축되고 연결되었습니다. 감사.
클래스 코드와 발신자 코드를 게시 할 수 있습니까? – Cosmin