|
我新建了一个Win32 Dynamic-Link Library项目,并添加好最基本的框架代码(test.cpp)。一切都没问题。
我需要在项目中引用到jrtplib库的文件。操作如下:
在project|Settings|Link中添加了jthread.lib jrtplib.lib(两个必须的库);
新建了一个类CRtp专门操作jrtplib相关功能;
在CRtp中添加了最基本的框架代码; (如果是exe项目,完全没有问题的)
然后在test.cpp中include rtp.h……
rtplibd.lib(rtpudpv4transmitter.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: char const * __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::c_str(void)const " (__imp_?c_
str@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPBDXZ)
jrtplibd.lib(rtpudpv4transmitter.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: unsigned int __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::length(void)const " (__imp_?l
ength@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ)
jrtplibd.lib(rtpudpv4transmitter.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned int const std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::npos" (__imp_?npos@?$basic_
string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@2IB)
jrtplibd.lib(rtpudpv4transmitter.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: unsigned int __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::find(char,unsigned int)const
" (__imp_?find@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIDI@Z)
jrtplibd.lib(rtpudpv4transmitter.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::~basic_string<char,struct std::char_traits
<char>,class std::allocator<char> >(void)" (__imp_??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ)
jrtplibd.lib(rtpudpv4transmitter.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) bool __cdecl std::operator==(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_st
ring<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_??8std@@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@0@Z)
jrtplibd.lib(rtpudpv4transmitter.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<
char>,class std::allocator<char> >(char const *,class std::allocator<char> const &)" (__imp_??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBDABV?$allocator@D@1@@Z)
jrtplibd.lib(rtpudpv4transmitter.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::ios_base::Init::Init(void)" (__imp_??0Init@ios_base@std@@QAE@XZ)
jrtplibd.lib(rtppollthread.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::ios_base::Init::Init(void)" (__imp_??0Init@ios_base@std@@QAE@XZ)
jrtplibd.lib(rtpudpv4transmitter.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::ios_base::Init::~Init(void)" (__imp_??1Init@ios_base@std@@QAE@XZ)
jrtplibd.lib(rtppollthread.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::ios_base::Init::~Init(void)" (__imp_??1Init@ios_base@std@@QAE@XZ)
jrtplibd.lib(rtpudpv4transmitter.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Winit::_Winit(void)" (__imp_??0_Winit@std@@QAE@XZ)
jrtplibd.lib(rtppollthread.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Winit::_Winit(void)" (__imp_??0_Winit@std@@QAE@XZ)
jrtplibd.lib(rtpudpv4transmitter.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Winit::~_Winit(void)" (__imp_??1_Winit@std@@QAE@XZ)
jrtplibd.lib(rtppollthread.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Winit::~_Winit(void)" (__imp_??1_Winit@std@@QAE@XZ)
jrtplibd.lib(rtpudpv4transmitter.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) bool __cdecl std::operator<(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_str
ing<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_??Mstd@@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@0@Z)
jrtplibd.lib(rtpudpv4transmitter.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<
char>,class std::allocator<char> >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z)
jrtplibd.lib(rtppollthread.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_ostream<char,struct std::char_traits<char> > & __thiscall std::basic_ostream<char,struct std::char_traits<char> >::operator<<
(class std::basic_ostream<char,struct std::char_traits<char> > & (__cdecl*)(class std::basic_ostream<char,struct std::char_traits<char> > &))" (__imp_??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z)
jrtplibd.lib(rtppollthread.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<(class std::basic_ostream<char,struct std::char_traits<char> >
&,char const *)" (__imp_??6std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z)
jrtplibd.lib(rtppollthread.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) class std::basic_ostream<char,struct std::char_traits<char> > std::cerr" (__imp_?cerr@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A)
jrtplibd.lib(rtppollthread.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::endl(class std::basic_ostream<char,struct std::char_traits<char> > &)" (_
_imp_?endl@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@1@AAV21@@Z)
Debug/testlib.ax : fatal error LNK1120: 17 unresolved externals
请问这该怎么解决啊?谢谢
--------------------
其他线索参考:
因为这个Dll开发需要,在Project|Settings|C/C++|Calling convention选择__stdcall. Settings|Link中选择了Ignore all default libraries.如果不选这个出现另一种link错误:
LIBCMTD.lib(dbgheap.obj) : error LNK2015: __malloc_dbg already defined in msvcrtd.lib(MSVCRTD.dll)
LIBCMTD.lib(dbgheap.obj) : error LNK2015: __free_dbg already defined in msvcrtd.lib(MSVCRTD.dll)
LIBCMTD.lib(crt0init.obj) : error LNK2015: ___xc_z already defined in msvcrtd.lib(cinitexe.obj)
LIBCMTD.lib(crt0init.obj) : error LNK2015: ___xc_a already defined in msvcrtd.lib(cinitexe.obj)...
|
|