简体   繁体   English

无法使用VS2013链接pdcurses静态调试版本

[英]Cannot link pdcurses static debug build with VS2013

I downloaded and compiled pdcurses. 我下载并编译了pdcurses。 As instructed from their documentation I used: 根据他们的文档中的说明,我使用了:

nmake -f vcwin32.mak DEBUG=Y pdcurses.lib

I also build pdcurses without the DEBUG tag so I can be on release mode. 我还构建了没有DEBUG标记的pdcurses,因此可以进入发布模式。

Now, I have a project where I want to statically link pdcurses. 现在,我有一个项目想要静态链接pdcurses。 I use MT and MTd as runtime libraries and I link the .lib files from DEBUG build when I'm on debug and the other .lib files when I'm on release. 我将MT和MTd用作运行时库,并在调试时链接来自DEBUG构建的.lib文件,而在发布时链接其他.lib文件。

When I build my project on release mode everything works fine but when I try to build on debug here is the error: 当我在发布模式下构建项目时,一切正常,但是当我尝试在调试时构建时,出现以下错误:

1>LIBCMT.lib(invarg.obj) : error LNK2005: "void __cdecl _invalid_parameter(unsigned short const *,unsigned short const *,unsigned short const *,unsigned int,unsigned int)" (?_invalid_parameter@@YAXPBG00II@Z) already defined in LIBCMTD.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005: "void __cdecl _invoke_watson(unsigned short const *,unsigned short const *,unsigned short const *,unsigned int,unsigned int)" (?_invoke_watson@@YAXPBG00II@Z) already defined in LIBCMTD.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005: __call_reportfault already defined in LIBCMTD.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005: __get_invalid_parameter_handler already defined in LIBCMTD.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005: __initp_misc_invarg already defined in LIBCMTD.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005: __invalid_parameter already defined in LIBCMTD.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005: __invoke_watson already defined in LIBCMTD.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005: __set_invalid_parameter_handler already defined in LIBCMTD.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005: ___pInvalidArgHandler already defined in LIBCMTD.lib(invarg.obj)
1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library

Any ideas what the problem may be? 任何想法可能是什么问题?

You are linking to both the debug and release static runtimes, don't do that. 您同时链接到调试和发布静态运行时,请不要这样做。 If you don't know which of your libraries is causing the issue then see this guide for steps on detecting that. 如果您不知道哪个库引起了问题,请参阅本指南中有关检测该问题的步骤。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM