Resolve cannot find or open the PDB file problem

Source: Internet
Author: User
Tags see definition win32

Use the mat in OpenCV today to preserve the average and standard deviation of the pixels inside the data;

But after the programming is done, the following problem occurs, and the PDB file cannot be found. Here are three workarounds and the cause of the problem.

The program also can not run out, the whole person is not good. Later on the bar and online search, there are a number of solutions, but the most used for me is the 1th one:

Method 1. First verify that the empty project is not established, not the Win32-bit console project, if the establishment of an empty project, it is recommended to change the empty project into a Win32-bit console project, the problem is solved at once.

Method 2. There is a saying that the problem is that the debug file PDB is not generated in an empty project, so debugging is not possible.

To have the project generate a PDB file, you need to change:

Item properties, configuration Properties->linker->generate Debug Info change from No to Yes

However, this is not enough and needs to be changed:

Project Properties, configuration properties->c/c++->debug Information format is/zi

Project properties, configuration Properties->c/c++->optimization to Disabled

Because in order to generate this file, you need to set the debug information format and turn off O2, and change the linker to generate debug information switch

When running FBX sample program found hint: Debug information of Xxx.exe cannot is found or not match, so first found the relevant information on the Internet, get the following suggestions:

1) Goto Project->helloworld Properties
2) on the left expand "Configuration Properties"
3) Expand "C + +"
4) on the left, select "General"
5) on the right, change ' Debug information Format ' to ' program Database for Edit and Continue (/zi) '
5) on the left, select "Optimization"
6) on the right, change "optimization" to "Disabled (/od)"
7) on the left, expand "Linker"
8) On the left, select "Debugging"
9) on the ' right ' , change ' Generate Debug Info ' to ' Yes '
( Ten) Click OK
One ) Set your breakpoints
Rebuild Your application

In fact, after doing this, the problem still exists because the visual configuration is not very familiar, so continue to look at other people's articles, think it might be the cause of the. pdb file, because the PDB file is where visual stores debugging information, and visual does have the following prompt at runtime:

' ImportExport.exe ': Loaded ' C:/Program files/autodesk/fbx/fbxsdk/2012.1/bin/importexport/win32/net2010/debug/ ImportExport.exe ', cannot find or open the PDB file

The PDB file cannot be found and therefore cannot be debugged.

A total of 2 PDB-related configuration options are found in visual:

Configuration property->c/c++->output files->program Database file name

This is the output location of the PDB file generated at compile time, and vs compiles the location to match the $ (TargetName). pdb format file to the output of the configuration property->general The directory directory (where the settings are not known to work) as debug information at run time. However, this PDB file contains information that includes type information, but does not include symbolic information such as function definitions. Therefore, even though each source file contains a common header file (such as <windows.h>), the typedef in these header files is stored only once, not in every OBJ file (see definition below). Therefore, this PDB file is not sufficient for debugging purposes.

Configuration property->linker->debugging->generate Program Database file

This is the output location of the PDB file that the linker produces when linking, and it contains debugging information for the project's EXE file. The file contains complete debugging information (including function prototypes), not just on the previous. The type information found in the PDB.

Both of these two PDB files allow incremental updates. The linker also embeds the path to the. pdb file in the. exe or. dll file that it creates.

Control the project configuration, and quickly find out where the problem lies. The file name set in output files->program database file name conforms to the format of $ (TargetName). PDB and is therefore copied to the output directory directory, and linker-> The file name of the Debugging->generate program database file is also exactly the same location, so it is not copied in, so the result of "Kang" is that the 9MB large PDB file containing the full debug information is not created as promised, The 1MB PDB file is incorrectly copied to the wrong place, the natural. exe file will not find the debug information.

Method 3. Ctrl + F5 to run it. or execute the program under the CMD command line. or "Microsoft Symbol Servers" on the Hook (Tools, Options, debugging, Symbols).

The following as a reference:

PDB files in VISUAL c+ and their role

The program database (PDB) file holds debugging and project state information that you can use to incrementally link the Debug configuration of your program. A PDB file is created when you build with/zi or/zi (for C + +).

In Visual C + +, the/fd option is used to name the PDB file created by the compiler. When you use the wizard to create a project in Visual Studio, the/fd option is set to create a named project. PDB for PDB.

If you use a makefile to create a C + + application and specify/ZI or/zi without specifying/FD, two PDB files will eventually be generated:

VC80. The PDB, more generally, is vcx0.pdb, where x represents the version of Visual C + +. This file stores all debugging information for each OBJ file and resides in the same directory as the project build file.

Project. PDB This file stores all debugging information for the. exe file. It resides in the/debug subdirectory, for native C + + code. For managed code, it resides in the/windebug subdirectory.

Each time you create an OBJ file, the C + + compiler merges debugging information into vcx0.pdb. The information that is inserted includes type information, but does not include symbolic information such as function definitions. Therefore, even though each source file contains a common header file (such as <windows.h>), the typedef in those header files is stored only once, not in every OBJ file.

The linker creates project. PDB, which contains debugging information for the project's EXE file. Project. The PDB file contains complete debugging information (including function prototypes), not just type information found in vcx0.pdb. Both of these two PDB files allow incremental updates. The linker also embeds the path to the. pdb file in the. exe or. dll file that it creates.

The Visual Studio Debugger uses the PDB path in an EXE or DLL file to find project. PDB file. If the debugger cannot find the PDB file at that location, or if the path is not valid (for example, if the project is moved to another computer), the debugger searches for the path that contains the EXE, which is the symbol path specified in the Options dialog box (debug folder, symbols node). The debugger does not load the PDB that does not match the binary being debugged.

Resolve cannot find or open the PDB file problem

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.