Я изменил существующий класс в своем визуальном приложении C ++, чтобы сделать его универсальным классом.Этот класс используется двумя другими модулями.Когда я компилирую эти модули отдельно, все работает.Однако, когда я делаю Build All, я получаю следующие ошибки компоновщика:
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)" (??0?$CRingBuffer@E@@QAE@K@Z) referenced in function "public: __thiscall CSerialPort::CSerialPort(void)" (??0CSerialPort@@QAE@XZ)
1>ZStackMTI.obj : error LNK2001: unresolved external symbol "public: __thiscall CRingBuffer<unsigned char>::CRingBuffer<unsigned char>(unsigned long)" (??0?$CRingBuffer@E@@QAE@K@Z)
1>SerialPort.obj : error LNK2019: unresolved external symbol "public: __thiscall CRingBuffer<unsigned char>::~CRingBuffer<unsigned char>(void)" (??1?$CRingBuffer@E@@QAE@XZ) referenced in function "public: void * __thiscall CRingBuffer<unsigned char>::`scalar deleting destructor'(unsigned int)" (??_G?$CRingBuffer@E@@QAEPAXI@Z)
1>ZStackMTI.obj : error LNK2001: unresolved external symbol "public: __thiscall CRingBuffer<unsigned char>::~CRingBuffer<unsigned char>(void)" (??1?$CRingBuffer@E@@QAE@XZ)
1>SerialPort.obj : error LNK2019: unresolved external symbol "public: unsigned long __thiscall CRingBuffer<unsigned char>::GetBufferItems(void)" (?GetBufferItems@?$CRingBuffer@E@@QAEKXZ) referenced in function "public: unsigned long __thiscall CSerialPort::GetBufferedRxItems(void)" (?GetBufferedRxItems@CSerialPort@@QAEKXZ)
1>SerialPort.obj : error LNK2019: unresolved external symbol "public: int __thiscall CRingBuffer<unsigned char>::Peek(unsigned char *,unsigned long,unsigned long *)" (?Peek@?$CRingBuffer@E@@QAEHPAEKPAK@Z) referenced in function "public: unsigned long __thiscall CSerialPort::Peek(unsigned char *,unsigned long,unsigned long *)" (?Peek@CSerialPort@@QAEKPAEKPAK@Z)
1>SerialPort.obj : error LNK2019: unresolved external symbol "public: int __thiscall CRingBuffer<unsigned char>::Remove(unsigned char *,unsigned long,unsigned long *)" (?Remove@?$CRingBuffer@E@@QAEHPAEKPAK@Z) referenced in function "public: unsigned long __thiscall CSerialPort::Read(unsigned char *,unsigned long,unsigned long *)" (?Read@CSerialPort@@QAEKPAEKPAK@Z)
1>ZStackMTI.obj : error LNK2001: unresolved external symbol "public: int __thiscall CRingBuffer<unsigned char>::Remove(unsigned char *,unsigned long,unsigned long *)" (?Remove@?$CRingBuffer@E@@QAEHPAEKPAK@Z)
1>SerialPort.obj : error LNK2019: unresolved external symbol "public: int __thiscall CRingBuffer<unsigned char>::Add(unsigned char *,unsigned long,int)" (?Add@?$CRingBuffer@E@@QAEHPAEKH@Z) referenced in function "public: unsigned long __thiscall CSerialPort::Write(unsigned char *,unsigned long)" (?Write@CSerialPort@@QAEKPAEK@Z)
1>ZStackMTI.obj : error LNK2001: unresolved external symbol "public: int __thiscall CRingBuffer<unsigned char>::Add(unsigned char *,unsigned long,int)" (?Add@?$CRingBuffer@E@@QAEHPAEKH@Z)
1>SerialPort.obj : error LNK2019: unresolved external symbol "public: int __thiscall CRingBuffer<unsigned char>::Delete(unsigned long)" (?Delete@?$CRingBuffer@E@@QAEHK@Z) referenced in function "public: unsigned long __thiscall CSerialPort::Delete(unsigned long,int)" (?Delete@CSerialPort@@QAEKKH@Z)
1>SerialPort.obj : error LNK2019: unresolved external symbol "public: int __thiscall CRingBuffer<unsigned char>::Flush(void)" (?Flush@?$CRingBuffer@E@@QAEHXZ) referenced in function "public: unsigned long __thiscall CSerialPort::Flush(int)" (?Flush@CSerialPort@@QAEKH@Z)
1>ZStackMTI.obj : error LNK2019: unresolved external symbol "public: unsigned char __thiscall CRingBuffer<unsigned char>::Peek(unsigned long)" (?Peek@?$CRingBuffer@E@@QAEEK@Z) referenced in function "unsigned long __cdecl ZBNConnect_GetExtAddr(unsigned char *)" (?ZBNConnect_GetExtAddr@@YAKPAE@Z)
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. Кто-нибудь знает, как это исправить?До доработок все построено и связано без проблем.Спасибо.