We need to surpress generation of debug symbols. The options availble under project properties/ configuration properties / c/c++ / general / debug information format, are equivalent to /Z7, /Zi and /ZI - I can't find a way to omit the /Zx flag entirely.
Unlike the situation here - we're building from the IDE.
I'm using visual studio 2010, and the project at hand is a static library.
EDIT:
Here's the view from my installation of VS2012. Is this some installation issue?? Are your Debug-Information-Format options different?
You can remove it manually:
Step 1. Compiler.
Selected "Configuration Properties > C/C++ > General > Debug Information Format"
Hit DEL
Step 2. Linker.
Also you need to disable generating Debug info for Linker
Selected "Configuration Properties > Linker > Debugging> Generate Debug Info" set to No
Step 3. Profiler.
Also set "Profile" to "No" in Linker > Advanced or you may still see PDB files generated!
First thing first - this is not recommended to disable .PDB generation, even for a Release Build!
Anyway, you just need to go:
Linker -> Debugging -> Generate Debug Info, and set it to No
Related
Is there a way to cancel the /DEBUG command line argument on Visual Studio's (2015+) link command?
I've tried /DEBUG:NO and /DEBUG- but neither is recognized.
In the project's properties, select the Linker -> Debugging options page and turn off "Generate Debug Info," as shown below:
(If this option is not shown, be sure that all other 'debug' options are disabled, such as "Use Debug Libraries" on the Configuration Properties -> Advanced page.)
Alternatively, to explicitly turn off the /DEBUG option in command-line builds, you can use the /DEBUG:NONE switch.
Right-click on the solution title in the Solution Explorer window, then go to Configuration Properties -> Configuration. The table appears, showing check-boxes, allowing to turn off/on a build of particular projects for certain configurations.
My solution and projects are generated with CMake.
Is it possible to turn off a particular project for Debug build configuration from CMakeLists.txt?
==
Background of a problem is failing build of Cython project for Debug config.
Release builds fine. CMake module was taken from this example on Github.
Debug config wants debug Python library python27_d.lib, that is forced by pyconfig.h. I use Anaconda python, which is missing this library.
Moreover, I don't need debug build of that project. I've unsuccessfully spent several hours, modifying CMakeLists.txt in various ways, trying to remove definition of _DEBUG macro from compiler command line. CLI parameter /D_DEBUG was absent in all dialogs with properties and "complete command line" listings, that Visual Studio has shown me. Nevertheless, something has always appended it.
So, I'd like to simply disable this project in Debug build for now.
This sets that check-box from the first part of the question to unchecked state:
set_property(TARGET <my Cython module>
PROPERTY EXCLUDE_FROM_DEFAULT_BUILD_DEBUG TRUE)
Now I wonder, where did compiler command line come from, because /D_DEBUG was absent in all dialogs with properties, that Visual Studio has shown me (second part of the question).
I am building this project in VS2013. Initially, that string /D_DEBUG was present in Project properties -> C/C++ -> Preprocessor -> Preprocessor definitions for the Debug configuration. Then I've added
string(REPLACE "/D_DEBUG" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
to my CMakeLists.txt file, building the Cython code, and that macro has disappeared from the Project properties.
Nevertheless, the project was still requiring python27_d.dll.
I've also added
#define _DEBUG
in one of files, and have got the following compiler warning
C:\projects\project\file.cpp(9): warning C4005: '_DEBUG' : macro redefinition
command-line arguments : see previous definition of '_DEBUG'
I'm linking an executable file with several static libraries (projects in my solution), and want to remove all internal function names from the final .exe file.
Which settings do I have to use for that, and do I have to do that in the library or executable project settings?
Simply building in Release mode doesn't strip the names out of the binary.
Go to Project -> Properties -> Configuration properties -> Linker and in the Debugging section set Generate Debug Info to "No".
Remove them using hex editor, they aren't used inside a code
Delete all pdb files from Project/bin folder.
In project settings -> Compi9le -> Advanced, set 'Generate debug info' to 'None' (instead of pdb-only).
Recompile project (in Release mode, with Generate debug info == None).
Visual studio creates pdb files in my project's bin folder even though Generate debug info is still None.
Why? And how can I get Visual Studio to stop generating these pdb files?
Are you certain that you have changed it for the correct build config. eg. You changed it for Release but you are compiling under debug?
I'm trying to suppress the command-line from the output in Visual Studio - my plan is to add /nologo to the command-line - but I can't find a place in the application settings or in the IDE settings to do this.
I'm probably missing something obvious, but would really appreciate any enlightenment.
Edit: What is causing me the problem can best be described by the following scenario:
I have a solution with multiple projects
I hit F7, to build all (or all currently configured to build via the Configuration Manager)
I hit F4 to step through the warnings/errors in the project(s)
At the start of every project's output (which is usually 0 warnings and 0 errors) is a statement such as the following:
"c:\WINDOWS\Microsoft.NET\Framework\v3.5\Csc.exe /noconfig /nowarn:1701,1702 /errorreport:prompt /warn:4 /define:TRACE /reference:"c:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll" /reference:c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /reference:c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll /reference:c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /debug:pdbonly /filealign:512 /optimize+ . . ."
The fact that these are output for every project (esp. when those projects don't have warnings or errors) makes my stepping any bona-fide warnings/errors a right royal PITA. I want to have the IDE not display these pointless information lines.
Tools | Options | Projects and Solutions | Build and Run | MSBuild project build output verbosity -> Quiet
The question isn't quite clear. By default in VS2005, if you right-click a project, select properties, and look under Configuration Properties -> C/C++ -> General, I think you'll see Suppress Startup Banner: Yes (/nologo)
This suppresses some banner info from the compiler. Is that what you want?