开发者

Build dll from command line [ Visual Studio ]

I have developed开发者_如何学Go a DLLin c++ using visual studio 2008. I want to run static code analysis on it using a tool which requires me to compile it on command line.

How can i use cl.exe to achieve this.

My project depends on the boost date_time library and couple other referenced projects.

How to build a DLL from the command line in Windows using MSVC

UPDATE: command line

cl /Od /GL /I "..\..\..\..\..\..\..\..\..\..\..\..\..\boost144" /I "..\include" /I "..\..\..\..\..\cincludes" /I "..\..\BASBESUtil\include" /I "..\..\..\..\..\..\..\..\..\..\..\wutility\include" /I "..\..\..\t\include" /I "..\..\..\..\..\..\..\..\..\..\..\enterprise\common\LicenseLib" /I "..\..\Common" /I "..\\" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "UNICODE" /D "_UNICODE_" /D "_WINDLL" /D "_UNICODE" /FD /EHa /MD /Zc:wchar_t- /Fo"Release\\" /Fd"Release\vc90.pdb" /W3 /c /Wp64 /Zi /TP <<src files >> /OUT:".\Release\snaplv.dll" /INCREMENTAL:NO /LIBPATH:"..\..\..\..\..\..\..\..\..\..\..\..\..\boost144\stage\lib" /DLL /MANIFEST /MANIFESTFILE:"Release\snaplv.dll.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"c:\DevEnv\PerforceWorkspace\dev\adamodarachar\snap-tools\LicenseValidator\main\enterprise\BAS\main\server\nativeutil\src\core\main\cpp\xyxmgr\xyxmgr\Release\snaplv.pdb" /SUBSYSTEM:CONSOLE /OPT:REF /OPT:ICF /LTCG /DYNAMICBASE:NO /MACHINE:X86 /NXCompat /DynamicBase version.lib Ws2_32.lib rpcrt4.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 <<obj files>>


Instead of calling the compiler executable directly and passing all those options manually, you can simply call MSVC, and pass the project file on the command line.

devenv.com MyProject.sln /Build "Release|x86_64" /Project MyLib

In my copy of MSVS v8, devenv.com can be found in C:\Programs\Microsoft Visual Studio 8\Common7\IDE. Call devenv.com /? for a list of options.


From the Tools menu select the option Visual Studio 2008 Command Prompt ?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜