链接器错误 C++ 视觉工作室2005
对于我什至没有直接调用的方法,我在 Visual Studio 中收到一大堆链接器错误。 我白天是一名 Java 开发人员,但我有一个需要用 C++ 完成的项目,旨在在 Windows 计算机上运行。 因此,我一直在使用 Visual Studio。
基本上,我有一个操作系统项目,我添加了一个访问器方法。 我将该项目编译为 .lib 文件(编译和链接正常)。
然后我有自己的项目使用该库。 我已将库包含在“项目”->“属性”->“项目”下。 链接器-> 输入,并在General->Set中设置相应的目录 其他 Lib 目录。 我已将标头包含在适当的文件中,并且我只是调用其中一个类的构造函数...甚至没有调用我创建的方法。
代码可以编译,但我收到以下大量链接器错误 - 主要是 LNK2019 和 LNK2001 错误。 我尝试在不同的设置(lib、exe 等)下重新编译,链接器错误似乎只会成倍增加。 当我切换回之前的设置时,错误数量仍保持在峰值。 任何想法如何解决这一问题?
构建日志
构建已开始:项目:SpamCapture,配置:Debug|Win32
命令行:
正在创建临时文件“c:\SpamCapture\SpamCapture\SpamCapture\Debug\RSP0000103081740.rsp”及其内容 [ /VERBOSE:LIB /OUT:"C:\SpamCapture\SpamCapture\SpamCapture\Debug\SpamCapture.exe" /INCRMENTAL /LIBPATH:"C:\SpamCapture\Config\Debug\" /MANIFEST /MANIFESTFILE:"Debug\SpamCapture.exe .intermediate.manifest" /NODEFAULTLIB:"libcmtd.lib" /NODEFAULTLIB:"nafxcwd.lib" /DEBUG /PDB:"c:\SpamCapture\SpamCapture\SpamCapture\Debug\SpamCapture.pdb" /SUBSYSTEM:CONSOLE /MACHINE:X86 KeyCapture_Config.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
“.\Debug\Interaction.obj”
“.\Debug\InteractionSet.obj”
“.\Debug\LogReader.obj”
“.\Debug\SpamCapture.obj”
“.\调试\stdafx.obj”
“.\Debug\SpamCapture.res”
“.\Debug\SpamCapture.exe.embed.manifest.res” ] 创建命令行“link.exe @c:\SpamCapture\SpamCapture\SpamCapture\Debug\RSP0000103081740.rsp /NOLOGO /ERRORREPORT:PROMPT”
输出窗口:
正在链接... LINK:警告 LNK4067:入口点不明确; 选择“mainCRTStartup” 搜索库 搜索 C:\SpamCapture\Config\Debug\KeyCapture_Config.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\lib\kernel32.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\user32.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\gdi32.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\winspool.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\comdlg32.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\advapi32.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\shell32.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\ole32.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\oleaut32.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\lib\uuid.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\odbc32.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\odbccp32.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\lib\msvcprtd.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\lib\MSVCRTD.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\lib\OLDNAMES.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\lib\mfc80ud.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\lib\mfcs80ud.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\msimg32.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\comctl32.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\shlwapi.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\lib\atlsd.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\wininet.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\ws2_32.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\mswsock.lib: 搜索 C:\SpamCapture\Config\Debug\KeyCapture_Config.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\lib\kernel32.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\user32.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\gdi32.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\winspool.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\comdlg32.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\advapi32.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\shell32.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\ole32.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\oleaut32.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\lib\uuid.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\odbc32.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\odbccp32.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\lib\msvcprtd.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\lib\MSVCRTD.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\lib\OLDNAMES.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\lib\mfc80ud.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\lib\mfcs80ud.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\msimg32.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\comctl32.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\shlwapi.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\lib\atlsd.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\wininet.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\ws2_32.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\mswsock.lib: 搜索 C:\SpamCapture\Config\Debug\KeyCapture_Config.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\lib\kernel32.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\user32.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\gdi32.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\winspool.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\comdlg32.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\advapi32.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\shell32.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\ole32.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\oleaut32.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\lib\uuid.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\odbc32.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\odbccp32.lib: 搜索 C:\Program Files\Microsoft Visual Studio 8\VC\lib\msvcprtd.lib: 库搜索完成
链接器错误从这里开始:
KeyCapture_Config.lib(KeyCapture_ConfigDlg.obj):错误LNK2001:无法解析的外部 符号“public: virtual int __thiscall CWnd::Create(char const *,char const *,unsigned long,struct tagRECT const &,class CWnd *,unsigned int,struct CCreateContext *)" (?创建@CWnd@@UAEHPBD0KABUtagRECT@@PAV1@IPAUCCreateContext@@@Z)
...还有很多这样的
KeyCapture_Config.lib(KeyCapture_ConfigDlg.obj):错误LNK2019:无法解析的外部 符号“public: struct HICON__ * thiscall CWinApp::LoadIconA(unsigned int)const ” (?LoadIconA@CWinApp@@QBEPAUHICON@@I@Z) 在函数“public: __thiscall”中引用 CKeyCapture_ConfigDlg::CKeyCapture_ConfigDlg(类 CWnd *)" (??0CKeyCapture_ConfigDlg@@QAE@PAVCWnd@@@Z)
...还有很多这样的
(?DoDataExchange@SetupDialog@@MAEXPAVCDataExchange@@@Z) C:\SpamCapture\SpamCapture\SpamCapture\Debug\SpamCapture.exe:致命错误 LNK1120:34 无法解析的外部
结果:
构建日志保存在“file://c:\SpamCapture\SpamCapture\SpamCapture\Debug\BuildLog.htm” SpamCapture - 44 个错误,1 个警告
I'm getting a whole bunch of linker errors in Visual studios for methods I'm not even calling directly. I'm a java developer by day, but I have a project I need to do in C++, intended to run on windows machines. Hence, I'm stuck messing about with Visual Studio.
Bascally, I have an os project that I added an accessor method to. I compiled that project as a .lib file (compiles and links fine).
I then have my own project that uses that lib. I've included the library under Project->Properties -> Linker -> Input, and set the appropriate directory in the General -> Additional Lib Directories. I've included the header in the appropriate file, and I'm simply calling the constructor of one of the classes...not even calling the method that I created yet.
The code compiles, but I get the following mountain of linker errors -- mostly LNK2019 and LNK2001 errors. I've tried recompiling under different settings (lib, exe, etc.), and the linker errors only seem to multiply. When I switch back to the previous settings, the number of errors remain at their peak. Any ideas how to fix this?
Build Log
Build started: Project: SpamCapture, Configuration: Debug|Win32
Command Lines:
Creating temporary file "c:\SpamCapture\SpamCapture\SpamCapture\Debug\RSP0000103081740.rsp" with contents
[
/VERBOSE:LIB /OUT:"C:\SpamCapture\SpamCapture\SpamCapture\Debug\SpamCapture.exe" /INCREMENTAL /LIBPATH:"C:\SpamCapture\Config\Debug\" /MANIFEST /MANIFESTFILE:"Debug\SpamCapture.exe.intermediate.manifest" /NODEFAULTLIB:"libcmtd.lib" /NODEFAULTLIB:"nafxcwd.lib" /DEBUG /PDB:"c:\SpamCapture\SpamCapture\SpamCapture\Debug\SpamCapture.pdb" /SUBSYSTEM:CONSOLE /MACHINE:X86 KeyCapture_Config.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib".\Debug\Interaction.obj"
".\Debug\InteractionSet.obj"
".\Debug\LogReader.obj"
".\Debug\SpamCapture.obj"
".\Debug\stdafx.obj"
".\Debug\SpamCapture.res"
".\Debug\SpamCapture.exe.embed.manifest.res"
]
Creating command line "link.exe @c:\SpamCapture\SpamCapture\SpamCapture\Debug\RSP0000103081740.rsp /NOLOGO /ERRORREPORT:PROMPT"
Output Window:
Linking...
LINK : warning LNK4067: ambiguous entry point; selected 'mainCRTStartup'
Searching libraries
Searching C:\SpamCapture\Config\Debug\KeyCapture_Config.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\lib\kernel32.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\user32.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\gdi32.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\winspool.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\comdlg32.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\advapi32.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\shell32.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\ole32.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\oleaut32.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\lib\uuid.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\odbc32.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\odbccp32.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\lib\msvcprtd.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\lib\MSVCRTD.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\lib\OLDNAMES.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\lib\mfc80ud.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\lib\mfcs80ud.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\msimg32.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\comctl32.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\shlwapi.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\lib\atlsd.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\wininet.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\ws2_32.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\mswsock.lib:
Searching C:\SpamCapture\Config\Debug\KeyCapture_Config.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\lib\kernel32.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\user32.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\gdi32.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\winspool.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\comdlg32.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\advapi32.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\shell32.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\ole32.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\oleaut32.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\lib\uuid.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\odbc32.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\odbccp32.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\lib\msvcprtd.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\lib\MSVCRTD.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\lib\OLDNAMES.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\lib\mfc80ud.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\lib\mfcs80ud.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\msimg32.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\comctl32.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\shlwapi.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\lib\atlsd.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\wininet.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\ws2_32.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\mswsock.lib:
Searching C:\SpamCapture\Config\Debug\KeyCapture_Config.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\lib\kernel32.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\user32.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\gdi32.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\winspool.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\comdlg32.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\advapi32.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\shell32.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\ole32.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\oleaut32.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\lib\uuid.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\odbc32.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\odbccp32.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\lib\msvcprtd.lib:
Finished searching libraries
Linker Errors start here:
KeyCapture_Config.lib(KeyCapture_ConfigDlg.obj) : error LNK2001: unresolved external
symbol "public: virtual int __thiscall CWnd::Create(char const *,char const *,unsigned
long,struct tagRECT const &,class CWnd *,unsigned int,struct CCreateContext *)"
(?Create@CWnd@@UAEHPBD0KABUtagRECT@@PAV1@IPAUCCreateContext@@@Z)
... a bunch more like this
KeyCapture_Config.lib(KeyCapture_ConfigDlg.obj) : error LNK2019: unresolved external
symbol "public: struct HICON__ * thiscall CWinApp::LoadIconA(unsigned int)const "
(?LoadIconA@CWinApp@@QBEPAUHICON@@I@Z) referenced in function "public: __thiscall
CKeyCapture_ConfigDlg::CKeyCapture_ConfigDlg(class CWnd *)"
(??0CKeyCapture_ConfigDlg@@QAE@PAVCWnd@@@Z)
...a bunch more like this
(?DoDataExchange@SetupDialog@@MAEXPAVCDataExchange@@@Z)
C:\SpamCapture\SpamCapture\SpamCapture\Debug\SpamCapture.exe : fatal error LNK1120: 34 unresolved externals
Results:
Build log was saved at "file://c:\SpamCapture\SpamCapture\SpamCapture\Debug\BuildLog.htm"
SpamCapture - 44 error(s), 1 warning(s)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
库
KeyCapture_Config.lib
使用 MFC GUI 类(CWnd
、CWinApp
等),但您将其链接到的应用程序是控制台应用程序(请参阅链接器命令行中的/SUBSYSTEM:CONSOLE
选项)。 这行不通。 您应该创建一个新的 MFC GUI 应用程序项目并将库添加到该项目中。编辑:我刚刚检查了您评论中的链接: http://dynamicnetservices.com /~will/academic/textinput/keycapture/ 看来 KeyCapture_Config 实际上是一个使用 KeyCapture DLL 的 MFC 对话框应用程序。 通过直接链接到
KeyCapture.lib
,可以在控制台应用程序中使用KeyCapture。The library
KeyCapture_Config.lib
is using MFC GUI classes (CWnd
,CWinApp
, etc), but the application you're linking it into is a console application (see the/SUBSYSTEM:CONSOLE
option in your linker command line). This won't work. You should create a new MFC GUI application project and add the library to that project.Edit: I've just checked the link in your comment: http://dynamicnetservices.com/~will/academic/textinput/keycapture/ and it seems that KeyCapture_Config is actually an MFC dialog application that uses the KeyCapture DLL. It may be possible to use KeyCapture in a console application by linking directly against
KeyCapture.lib
.链接错误似乎抱怨缺少很多 MFC 函数,并且链接行包括: /NODEFAULTLIB:"nafxcwd.lib" ,这将排除 MFC。 您链接的库是用 MFC 构建的吗?
其他需要检查的事情是您正在使用相同的字符集(即都是多字节或都是 unicode)编译应用程序和库。
当您构建库时,没有链接步骤,因此可以将任意对象集合放入库中,而不考虑它们可能还需要什么。
The link error seem to be complaining about the lack of a lot of MFC functions, and you link lines includes: /NODEFAULTLIB:"nafxcwd.lib" which would exclude MFC. Is the lib you are linking against built with MFC?
Other things to check are that you are compiling the app and the lib with the same character set (ie. both multibyte or both unicode).
When you are building a lib there is no link step, so an arbitrary collection of objects can be thrown into a lib without any regard for what else they might need.
您的项目似乎正在与调试多线程运行时链接。 这是你的意图吗? 如果是这样,则可能与您使用的 KeyCapture_Config 库不一致。
KeyCapture_Config 是第 3 方库吗? 如果是这样,您是从源代码构建它还是为您提供了 lib/dll?
可能只需要对构建的 C/C++ 运行时进行一些调查即可。 您可以参考 Microsoft 知识库文章,它可能有助于阐明可能的运行时构建差异。
It looks like your project is linking with the Debug Multithreaded runtime. Is this your intention? If so there may be inconsistencies with the KeyCapture_Config library that you seem to be using.
Is KeyCapture_Config a 3rd party library? If so did you build it from source or was the lib/dll provided for you?
It may just take some investigation on which C/C++ runtimes are being built against. You can reference the Microsoft KB Article that might help shed some light on the possible runtime build discrepancies.
我认为罗布·沃克已经解决了这个问题。 如果 KeyCapture_Config.lib 的文档表明没有与 MFC 的链接,请检查源以获取需要链接到 MFC 的指令。 像这样的事情:
会导致对 MFC 的依赖,并且 KeyCapture_Config.lib 文档可能已过时。
I think that Rob Walker has nailed the problem. If the documentation for KeyCapture_Config.lib says no linkage to MFC, check the source for directives that require linkage to MFC. Something like this:
would cause a dependency on MFC, and the KeyCapture_Config.lib doc may be out of date.