我有以下(示例)代码,我需要编译一个发行版本。
// library.cpp : Defines the exported functions for the DLL application.
//
#include <stdio.h>
extern "C"
{
__declspec(dllexport) void DisplayHelloFromDLL( int value)
{
printf("Hello from DLL : data=%d\n", value);
}
}
代码编译并链接一个问题,它指的是调试版本 运行时库,无论我尝试什么。
Platform Visual Studio 2013更新5
问题 - 指向MSVCR120d.dll而不是MSVCR120.dll的链接
配置发布 - Win32 Dll
Manifest Present
编译器CLI
/ GS / GL / analyze- / W3 / Gy / Zc:wchar_t / Zi / Gm- / O2 /Fd" ;Release\vc120.pdb" / fp:exact / D&#34; WIN32&#34; / D&#34; NDEBUG&#34; / D&#34; _WINDOWS&#34; / D&#34; _USRDLL&#34; / D&#34; LIBRARY_EXPORTS&#34; / D&#34; _WINDLL&#34; / D&#34; _UNICODE&#34; / D&#34; UNICODE&#34; / errorReport:prompt / WX- / Zc:forScope / Gd / Oy- / Oi / MD / Fa&#34; Release \&#34; / EHsc / nologo / Fo&#34;发布\&#34; /Fp"Release\library.pch"
Note: /MD is correct i.e. no static, no debug, dll
链接器CLI
/ OUT:&#34; C:_progdbg \ Call_DLL \来电\推出\ library.dll&#34; / MANIFEST / LTCG / NXCOMPAT /PDB:"C:_progdbg\Call_DLL\Caller\Release\library.pdb" / DYNAMICBASE&#34; kernel32.lib&#34; &#34; USER32.LIB&#34; &#34; GDI32.LIB&#34; &#34; winspool.lib&#34; &#34; comdlg32.lib&#34; &#34; advapi32.lib&#34; &#34; SHELL32.LIB&#34; &#34; ole32.lib&#34; &#34; oleaut32.lib&#34; &#34; UUID.LIB&#34; &#34; odbc32.lib&#34; &#34; odbccp32.lib&#34; /IMPLIB:"C:_progdbg\Call_DLL\Caller\Release\library.lib" / DLL / MACHINE:X86 / OPT:REF / SAFESEH / INCREMENTAL:NO /PGD:"C:_progdbg\Call_DLL\Caller\Release\library.pgd" / SUBSYSTEM:WINDOWS / MANIFESTUAC:&#34; level =&#39; asInvoker&#39; uiAccess =&#39;假&#39;&#34; / ManifestFile:&#34; Release \ library.dll.intermediate.manifest&#34; / OPT:ICF / ERRORREPORT:PROMPT / NOLOGO / TLBID:1
Dependency Walker显示该库依赖于MSVCR120d.dll
有人可以告诉我哪个设置有误。
非常感谢