How do I show command-line build options in Visual C++ 2008?
Asked Answered
C

3

9

In a Visual C++ 2008 project, building a project will display following information in the output window:

1>------ Build started: Project: Project1, Configuration: Debug Win32 ------
1>Compiling...
1>main.cpp
1>test1.cpp
1>test2.cpp
1>Generating Code...
1>Linking...
1>LINK : test.exe not found or not built by the last incremental link; performing full link
1>Project1- 0 error(s), 0 warning(s)
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

How can I get output like this:

cl.exe /Od /I "includepath" /D "_UNICODE" /FD /EHsc /RTC1 /MDd /Zc:wchar_t- /Fo"Debug\\" /Fd"Debug\vc90.pdb" /nologo /c /ZI /TP /errorReport:prompt

Like a C# project will do it.

Contempt answered 5/5, 2009 at 8:18 Comment(0)
M
14

This is controlled via the "Suppress startup banner" setting in the "General" sub-tab of the "C/C++" tab in the project's property pages. If you set it to "No", it will show in the Output window the command line being used during compilation.

Matabele answered 5/5, 2009 at 8:32 Comment(0)
F
7

Switch on build logging (menu ToolsOptionsProjects and SolutionsVC++ Project SettingsBuild Logging). You should then get a build log (BuildLog.htm) in your intermediate files directory which contains all the information you need, including error messages. You will also get a Ctrl-clickable link in the output window to display the build log.

Finnigan answered 5/5, 2009 at 8:49 Comment(1)
This one is handy because it also shows command lines for custom build steps, not just the compiler/linker.Cervantez
T
3

You can view the options passed to cl via project properties → C/C++Command Line.

I am working on a German version of Visual Studio 2005, so I hope my translations do map to the English Visual Studio.

Tentacle answered 5/5, 2009 at 8:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.