错误 LNK2019:无法解析的外部符号“toString(int)”
环境:Windows XP。 Visual Studios 2010。语言 - C++。
我遇到了以下链接错误&已经没有办法解决这个问题了。我有一个项目(CnD Device),它链接到我的团队控制的 2 个项目(Messages 和 Carbon)。我尝试在 3 个项目之间搜索项目属性,
enter tcp_driver.obj : error LNK2019: unresolved external symbol "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl toString(int)" (?toString@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@H@Z) referenced in function "protected: bool __thiscall Tcp_Driver::readMessage(void)" (?readMessage@Tcp_Driver@@IAE_NXZ)
我相信这个问题是因为我没有链接到标准 C++ 库中的字符串。我一遍又一遍地扫描我的财产清单。以下是我认为对于此问题至关重要的一些属性。
CnD 设备属性信息:
- 配置类型 动态库.dll
- 使用 MFC 在共享 DLL 中使用 MFC
- 使用 ALT 不使用 ALT
- 字符集 使用多字节字符集
- 运行时库 多线程 DLL (/MD)
- 其他依赖项 msvcprtd.lib、Carbon.lib、 BUFFER_API.lib、BUFFER_FRAMEWORK.lib、Messages.lib
- 忽略所有默认库 无
消息属性信息:
- 配置类型 静态库 (.lib)
- MFC 的使用 在共享 DLL 中使用 MFC
- 使用 ALT 不使用 ALT
- 字符集 使用 Unicode 字符集
- 运行时库多线程 DLL (/MD)
- 其他依赖项
- 链接库依赖项 无
Carbon 属性信息:
- 配置类型 静态库 (.lib)
- 使用 MFC 在共享 DLL 中使用 MFC
- 使用 ALT 不使用 ALT
- 字符集 使用 Unicode 字符集
- 运行时库线程DLL (/MD)
- 链接库依赖项 否
我的 CnD 链接输出是:
1>------ Rebuild All started: Project: CnD_Device, Configuration: Debug Win32 ------
1> JDTC_Message.cpp
1>h:\my.name_local_project\project\emd\ofp\cp_sys\packages\cnd_device\src\project_message.cpp(47): warning C4018: '<' : signed/unsigned mismatch
1>h:\my.name_local_project\project\emd\ofp\cp_sys\packages\cnd_device\src\project_message.cpp(54): warning C4244: '=' : conversion from 'float' to 'UInt32', possible loss of data
1>h:\my.name_local_project\project\emd\ofp\cp_sys\packages\cnd_device\src\project_message.cpp(82): warning C4244: '=' : conversion from 'UInt32' to 'float', possible loss of data
1> ComponentEntryDLL.cpp
1> CnD_Network_Driver.cpp
1> CnD_Message_Handler.cpp
1> CnD_Message_Factory.cpp
1> CnD_Heartbeat_Message.cpp
1> CnD_Device.cpp
1> _WIN32_WINNT not defined. Defaulting to _WIN32_WINNT_MAXVER (see WinSDKVer.h)
1>h:\my.name_local_project\project\emd\ofp\cp_sys\packages\cnd_device\src\cnd_device.cpp(61): warning C4101: 'e' : unreferenced local variable
1>h:\my.name_local_project\project\emd\ofp\cp_sys\packages\cnd_device\src\cnd_device.cpp(120): warning C4101: 'e' : unreferenced local variable
1> MonitoringData.cpp
1> tcp_driver.cpp
1> _WIN32_WINNT not defined. Defaulting to _WIN32_WINNT_MAXVER (see WinSDKVer.h)
1> Generating Code...
1>h:\my.name_local_project\project\emd\ofp\cp_sys\packages\cnd_device\src\cnd_message_factory.cpp(59): warning C4715: 'CnD_Message_Factory::createMessage' : not all control paths return a value
1>
1> Searching libraries
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\msvcprtd.lib:
1> Searching ..\..\..\..\..\..\Carbon\debug\lib\Carbon.lib:
1> Searching ..\..\..\..\..\..\..\EMD\BUFFER_SDK\Libs\BUFFER_API.lib:
1> Searching ..\..\..\..\..\..\..\EMD\BUFFER_SDK\Libs\BUFFER_Framework.lib:
1> Searching ..\..\..\..\..\..\Messages\Debug\lib\Messages.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\lib\mfc100d.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\lib\mfcs100d.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\msvcrtd.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\kernel32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\user32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\gdi32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\msimg32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\comdlg32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\winspool.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\advapi32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\shell32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\comctl32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\shlwapi.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\uuid.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\lib\atlsd.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\ole32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\oleaut32.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\MSVCRT.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\OLDNAMES.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\lib\mfc100ud.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\lib\mfcs100ud.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\msvcprt.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\wininet.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\ws2_32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\mswsock.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\msvcprtd.lib:
1> Searching ..\..\..\..\..\..\Carbon\debug\lib\Carbon.lib:
1> Searching ..\..\..\..\..\..\..\EMD\BUFFER_SDK\Libs\BUFFER_API.lib:
1> Searching ..\..\..\..\..\..\..\EMD\BUFFER_SDK\Libs\BUFFER_Framework.lib:
1> Searching ..\..\..\..\..\..\Messages\Debug\lib\Messages.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\lib\mfc100d.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\lib\mfcs100d.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\msvcrtd.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\kernel32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\user32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\gdi32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\msimg32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\comdlg32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\winspool.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\advapi32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\shell32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\comctl32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\shlwapi.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\uuid.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\lib\atlsd.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\ole32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\oleaut32.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\MSVCRT.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\OLDNAMES.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\lib\mfc100ud.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\lib\mfcs100ud.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\msvcprt.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\wininet.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\ws2_32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\mswsock.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\msvcprtd.lib:
1> Searching ..\..\..\..\..\..\Carbon\debug\lib\Carbon.lib:
1> Searching ..\..\..\..\..\..\..\EMD\BUFFER_SDK\Libs\BUFFER_API.lib:
1> Searching ..\..\..\..\..\..\..\EMD\BUFFER_SDK\Libs\BUFFER_Framework.lib:
1> Searching ..\..\..\..\..\..\Messages\Debug\lib\Messages.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\lib\mfc100d.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\lib\mfcs100d.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\msvcrtd.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\kernel32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\user32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\gdi32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\msimg32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\comdlg32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\winspool.lib:
1>
1> Finished searching libraries
1> Creating library H:\my.name_local_project\project\EMD\OFP\CP_SYS\packages\CnD_Device\build\CnD_Device\Debug\CnD_Device.lib and object H:\my.name_local_project\project\EMD\OFP\CP_SYS\packages\CnD_Device\build\CnD_Device\Debug\CnD_Device.exp
1>
1> Searching libraries
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\msvcprtd.lib:
1> Searching ..\..\..\..\..\..\Carbon\debug\lib\Carbon.lib:
1> Searching ..\..\..\..\..\..\..\EMD\BUFFER_SDK\Libs\BUFFER_API.lib:
1> Searching ..\..\..\..\..\..\..\EMD\BUFFER_SDK\Libs\BUFFER_Framework.lib:
1> Searching ..\..\..\..\..\..\Messages\Debug\lib\Messages.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\lib\mfc100d.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\lib\mfcs100d.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\msvcrtd.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\kernel32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\user32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\gdi32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\msimg32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\comdlg32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\winspool.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\advapi32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\shell32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\comctl32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\shlwapi.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\uuid.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\lib\atlsd.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\ole32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\oleaut32.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\MSVCRT.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\OLDNAMES.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\lib\mfc100ud.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\lib\mfcs100ud.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\msvcprt.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\wininet.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\ws2_32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\mswsock.lib:
1>
1> Finished searching libraries
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>LINK : warning LNK4098: defaultlib 'mfc100ud.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
1>LINK : warning LNK4098: defaultlib 'mfcs100ud.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
1>tcp_driver.obj : error LNK2019: unresolved external symbol "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl toString(int)" (?toString@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@H@Z) referenced in function "protected: bool __thiscall Tcp_Driver::readMessage(void)" (?readMessage@Tcp_Driver@@IAE_NXZ)
1>H:\my.name_local_project\project\EMD\OFP\CP_SYS\packages\CnD_Device\build\CnD_Device\Debug\CnD_Device.dll : fatal error LNK1120: 1 unresolved externals
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
Environment: Windows XP. Visual Studios 2010. Language - C++.
I have run into the following link error & have run out of ideas how to fix this problem. I have a project (CnD Device) which links to 2 projects (Messages & Carbon) controlled by my group. I have tried to search for project properties between the 3 projects
enter tcp_driver.obj : error LNK2019: unresolved external symbol "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl toString(int)" (?toString@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@H@Z) referenced in function "protected: bool __thiscall Tcp_Driver::readMessage(void)" (?readMessage@Tcp_Driver@@IAE_NXZ)
I believe this problem is because I am not linking to the string which is in Standard C++ Library. I have scanned my properties list over and over again. Below is some of the properties I believe are critical for this problem.
CnD Device property information:
- Configuration Type Dynamic Library .dll
- Use of MFC Use MFC in a Shared DLL
- Use of ALT Not Using ALT
- Character Set Use Multi-Byte Character Set
- Runtime Library Multi-threaded DLL (/MD)
- Additional Dependencies msvcprtd.lib, Carbon.lib, BUFFER_API.lib, BUFFER_FRAMEWORK.lib, Messages.lib
- Ignore All Default Libraries No
Messages Properties Information:
- Configuration Type Static Library (.lib)
- Use of MFC Use MFC in a Shared DLL
- Use of ALT Not Using ALT
- Character Set Use Unicode Character Set
- Runtime Library Multi-threaded DLL (/MD)
- Additional Dependencies
- Link Library Dependencies No
Carbon Properties Information:
- Configuration Type Static Library (.lib)
- Use of MFC Use MFC in a Shared DLL
- Use of ALT Not Using ALT
- Character Set Use Unicode Character Set
- Runtime Library Multi-threaded DLL (/MD)
- Link Library Dependencies No
My CnD link output is:
1>------ Rebuild All started: Project: CnD_Device, Configuration: Debug Win32 ------
1> JDTC_Message.cpp
1>h:\my.name_local_project\project\emd\ofp\cp_sys\packages\cnd_device\src\project_message.cpp(47): warning C4018: '<' : signed/unsigned mismatch
1>h:\my.name_local_project\project\emd\ofp\cp_sys\packages\cnd_device\src\project_message.cpp(54): warning C4244: '=' : conversion from 'float' to 'UInt32', possible loss of data
1>h:\my.name_local_project\project\emd\ofp\cp_sys\packages\cnd_device\src\project_message.cpp(82): warning C4244: '=' : conversion from 'UInt32' to 'float', possible loss of data
1> ComponentEntryDLL.cpp
1> CnD_Network_Driver.cpp
1> CnD_Message_Handler.cpp
1> CnD_Message_Factory.cpp
1> CnD_Heartbeat_Message.cpp
1> CnD_Device.cpp
1> _WIN32_WINNT not defined. Defaulting to _WIN32_WINNT_MAXVER (see WinSDKVer.h)
1>h:\my.name_local_project\project\emd\ofp\cp_sys\packages\cnd_device\src\cnd_device.cpp(61): warning C4101: 'e' : unreferenced local variable
1>h:\my.name_local_project\project\emd\ofp\cp_sys\packages\cnd_device\src\cnd_device.cpp(120): warning C4101: 'e' : unreferenced local variable
1> MonitoringData.cpp
1> tcp_driver.cpp
1> _WIN32_WINNT not defined. Defaulting to _WIN32_WINNT_MAXVER (see WinSDKVer.h)
1> Generating Code...
1>h:\my.name_local_project\project\emd\ofp\cp_sys\packages\cnd_device\src\cnd_message_factory.cpp(59): warning C4715: 'CnD_Message_Factory::createMessage' : not all control paths return a value
1>
1> Searching libraries
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\msvcprtd.lib:
1> Searching ..\..\..\..\..\..\Carbon\debug\lib\Carbon.lib:
1> Searching ..\..\..\..\..\..\..\EMD\BUFFER_SDK\Libs\BUFFER_API.lib:
1> Searching ..\..\..\..\..\..\..\EMD\BUFFER_SDK\Libs\BUFFER_Framework.lib:
1> Searching ..\..\..\..\..\..\Messages\Debug\lib\Messages.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\lib\mfc100d.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\lib\mfcs100d.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\msvcrtd.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\kernel32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\user32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\gdi32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\msimg32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\comdlg32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\winspool.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\advapi32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\shell32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\comctl32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\shlwapi.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\uuid.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\lib\atlsd.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\ole32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\oleaut32.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\MSVCRT.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\OLDNAMES.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\lib\mfc100ud.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\lib\mfcs100ud.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\msvcprt.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\wininet.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\ws2_32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\mswsock.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\msvcprtd.lib:
1> Searching ..\..\..\..\..\..\Carbon\debug\lib\Carbon.lib:
1> Searching ..\..\..\..\..\..\..\EMD\BUFFER_SDK\Libs\BUFFER_API.lib:
1> Searching ..\..\..\..\..\..\..\EMD\BUFFER_SDK\Libs\BUFFER_Framework.lib:
1> Searching ..\..\..\..\..\..\Messages\Debug\lib\Messages.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\lib\mfc100d.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\lib\mfcs100d.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\msvcrtd.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\kernel32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\user32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\gdi32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\msimg32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\comdlg32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\winspool.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\advapi32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\shell32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\comctl32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\shlwapi.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\uuid.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\lib\atlsd.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\ole32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\oleaut32.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\MSVCRT.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\OLDNAMES.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\lib\mfc100ud.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\lib\mfcs100ud.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\msvcprt.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\wininet.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\ws2_32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\mswsock.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\msvcprtd.lib:
1> Searching ..\..\..\..\..\..\Carbon\debug\lib\Carbon.lib:
1> Searching ..\..\..\..\..\..\..\EMD\BUFFER_SDK\Libs\BUFFER_API.lib:
1> Searching ..\..\..\..\..\..\..\EMD\BUFFER_SDK\Libs\BUFFER_Framework.lib:
1> Searching ..\..\..\..\..\..\Messages\Debug\lib\Messages.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\lib\mfc100d.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\lib\mfcs100d.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\msvcrtd.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\kernel32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\user32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\gdi32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\msimg32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\comdlg32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\winspool.lib:
1>
1> Finished searching libraries
1> Creating library H:\my.name_local_project\project\EMD\OFP\CP_SYS\packages\CnD_Device\build\CnD_Device\Debug\CnD_Device.lib and object H:\my.name_local_project\project\EMD\OFP\CP_SYS\packages\CnD_Device\build\CnD_Device\Debug\CnD_Device.exp
1>
1> Searching libraries
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\msvcprtd.lib:
1> Searching ..\..\..\..\..\..\Carbon\debug\lib\Carbon.lib:
1> Searching ..\..\..\..\..\..\..\EMD\BUFFER_SDK\Libs\BUFFER_API.lib:
1> Searching ..\..\..\..\..\..\..\EMD\BUFFER_SDK\Libs\BUFFER_Framework.lib:
1> Searching ..\..\..\..\..\..\Messages\Debug\lib\Messages.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\lib\mfc100d.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\lib\mfcs100d.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\msvcrtd.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\kernel32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\user32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\gdi32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\msimg32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\comdlg32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\winspool.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\advapi32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\shell32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\comctl32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\shlwapi.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\uuid.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\lib\atlsd.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\ole32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\oleaut32.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\MSVCRT.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\OLDNAMES.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\lib\mfc100ud.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\lib\mfcs100ud.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\msvcprt.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\wininet.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\ws2_32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\mswsock.lib:
1>
1> Finished searching libraries
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>LINK : warning LNK4098: defaultlib 'mfc100ud.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
1>LINK : warning LNK4098: defaultlib 'mfcs100ud.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
1>tcp_driver.obj : error LNK2019: unresolved external symbol "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl toString(int)" (?toString@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@H@Z) referenced in function "protected: bool __thiscall Tcp_Driver::readMessage(void)" (?readMessage@Tcp_Driver@@IAE_NXZ)
1>H:\my.name_local_project\project\EMD\OFP\CP_SYS\packages\CnD_Device\build\CnD_Device\Debug\CnD_Device.dll : fatal error LNK1120: 1 unresolved externals
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现了我的问题。我会删除这个;然而,我发现这个链接错误很常见,但除了项目属性更改之外,从来没有好的通用解决方案。
我的问题的根源:
Carbon 和 Messages 将 Int32 定义为 long。
CnD 将 Int32 定义为 int。
导致错误的未解析的外部符号是
因此 CnD 期望的函数与 Carbon 和 Messages 定义的函数不同。
I found my problem. I would delete this; however, I found this link error is common but never have good general solutions - besides project property changes.
The source of my problem:
Carbon and Messages defined Int32 as a long.
CnD defined Int32 as an int.
The unresolved external symbol causing the error was
Thus CnD was expecting a different function than what Carbon and Messages defined.