views:

64

answers:

2

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!) :-)

+2  A: 

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.

Gerald
Thanks for this! I figured out my problem from the build log. I had all the compile/link switches correct but I hadn't added the manifest to the DLL which was making it fail to link at run time. I'm from a linux background so wasn't too aware of DLLs and all their intricacies.
Benj
A: 

Not an easy solution: you can parse the contents of the *.vcproj file and generate the result command line, but you have to parse all existing linker parameters by yourself.

AndreiM