开发者

How can I get the exact compiler command line from visual studio?

I have to port the build of a DLL from building in Visual Studio to another build system. The 开发者_高级运维DLL solution wasn't made by me and it's got lots of modified command line switches etc. I've copied the compiler/linker options from Visual Studio's

Project Properties -> Config Properties -> C/C++ -> Command Line Project Properties -> Config Properties -> Linker -> Command Line

However, when I build the DLL from my other build tool (and I've also tried a simple batch file) the DLL is a slightly different size and causes a crash sometimes when the DLL is used (which the one built by vis studio doesn't do).

So my question is:

  1. Is there a better way to see the exact command line than what's in vis studio properties page?

  2. Does Vis Studio do any crazy magic beyond what's happening on the command line (I hope the answer to this is no!) :-)


Something to keep in mind is that command-line options can be set per-source file too, not just per-project, which may be what you're missing.

One way to see everything that's going on is to look at the build log. At the end of the build in the Output view, you should see a line like:

Build log was saved at "file path".

Ctrl-click the file path in the output view and it will load the log file, and you should see all of the command lines for each file.

Update:

This answer was for Visual Studio 2008. You no longer get the link in the output window in newer versions of Visual Studio. Instead you have to navigate to the build directory for your project to see the log file. See here:

https://msdn.microsoft.com/en-us/library/jj651643.aspx

Actually that link is slightly wrong. The log file has a .log extension rather than .txt.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜