项目中源程序编写好以后,

(一个简单的小程序)
#include
int main(void)
{
int age;
int day;

age = 24;
printf("tom is %d years
old\n",age);
printf("tom has been on earth for %d
days\n",age*365);
//getchar();

return 0;
}
直接点击启动调试或者按F5,出现以下提示:

“exercise3.exe”: 已加载“E:\C语言学习Primer
Plus\第二章\exercise3\Debug\exercise3.exe”,已加载符号。
“exercise3.exe”:
已加载“C:\Windows\SysWOW64\ntdll.dll”,Cannot find or open the PDB
file
“exercise3.exe”:
已加载“C:\Windows\SysWOW64\kernel32.dll”,Cannot find or open the PDB
file
“exercise3.exe”:
已加载“C:\Windows\SysWOW64\KernelBase.dll”,Cannot find or open the PDB
file
程序“[872] exercise3.exe: 本机”已退出,返回值为 0
(0x0)。

但是程序运行完了,主函数的返回值也为零,只是dos窗口一闪而过,并且提示以上消息。
上网查看原因,得知是程序输出的地方是Windows系统,而不是vs2010。所以调试的话需要调用系统的一些资源,要到microsoft官网上下载,这样每次调试都比较耗费时间(操作方法:Tools---Options---Debugging---Symbols,
将microsoft symbol servers 勾选上即可),因为每次调试会从官网下载符号服务文件吧。
解决办法,可以按control+F5直接运行,而且这样操作的话dos窗口就不会一闪而过了


关于这个问题,visual studio工作室的人有回答,参考下文:
Hello,

We apologize if these messages are confusing, but is there any functionality you are expecting that is not available in the debugger? The symbol files (.pdb's) that cannot be found are the symbol files for the Windows system .dll's, and the only reason that you would need these is if you are trying to obtain complete callstacks including the Windows components, or debug into the Windows system API's. If you need the symbols, they are available from the Microsoft Public Symbol servers by checking the "Microsoft Symbol Servers" box under symbol settings (Tools -> Options -> Debugging -> Symbols).

However, as I mentioned, unless you are unable to debug something in Windows you are expecting to be able to, there is no need to ever load these .pdb files to debug your application, and enabling the symbol servers will slow down your debugging experience since you will be loading more data into the debugging and making a network call to the symbol server (this can be mitigated by enabling a symbol cache on the symbol dialogue).

Best Regards,

Visual Studio Debugger


(资料参考百度知道文库和他人博客等,感谢前人的解答)

vs2010调试程序出现“Cannot find or open the PDB file”的更多相关文章

  1. VS2010编译错误:fatal error C1189: #error : This file requires _WIN32_WINNT to be #defined at least to 0x

    下面是彻底解决方法:在工程的stdafx.h中添加(如有类似语句,需注释掉)#ifndef WINVER // Allow use of features specific to Windows 95 ...

  2. VS2010 配置与调试

    一.VS2010项目属性配置 使用VS调试程序,出现错误:"无法启动程序"***\**.exe".系统找不到指定的文件".网上找来解决办法, 也未能解决,但这些 ...

  3. VS2003转VS2010 fatal error C1189: #error

    我自己的mfc的demo要转换编译环境出现以下编译错误: VS2010编译错误:fatal error C1189: #error : This file requires _WIN32_WINNT ...

  4. vs2010中文简体版下载链接(含中文msdn)

    昨天朋友说vs2010中文版能够下载了,自己開始还不相信,正好周末,于是就下载了试一下 安装了果然是中文版,本来是msdn订阅用户才干够下载的,感谢上传的网友. 文件名称 cn_visual_stud ...

  5. vs2010下载链接中国简体(中国含msdn)

    昨天一个朋友说vs2010中国版可下载,我开始不相信.只是周末.所以,我下载一试 果然,安装了中国版,原本msdn订户才能够下载,感谢朋友们上传. 文件名 cn_visual_studio_2010_ ...

  6. 64位win7+PCL1.6.0+VS2010,64位win10+PCL1.6.0+VS2010

    https://blog.csdn.net/liukunrs/article/details/80216329 大体转载自:https://blog.csdn.net/sinat_24206709/a ...

  7. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt".

    昨天遇到一个比较奇怪的问题,运行VS2010调试程序的时候,总是会报一个错,然后程序就挂掉了:无可用源….,弹出一个窗口提示:System.AccessViolationException: Atte ...

  8. 当VS和Flash builder同时运行时

    1, 运行环境: windows 7,   VS2010,   Flash Builder 4.6 2, 在Flash Builder中运行工作空间和VS2010调试程序是同一个时,也就说在Flash ...

  9. VS 2010 问题集锦

    1.Cannot find or open the PDB file 用vs2010写程序时,经常遇到:按F5,提示命令符一闪而过,且显示“Cannot find or open the PDB fi ...

随机推荐

  1. vijos1740 聪明的质监员 (二分、区间求和)

    http://www.rqnoj.cn/problem/657 https://www.vijos.org/p/1740 P1740聪明的质检员 请登录后递交 标签:NOIP提高组2011[显示标签] ...

  2. SQL Server 2012不支持从SQL Server 2000的备份进行还原

    错误: dbbackup failed: Unable to restore database 'ppt'Not valid backupThe database was backed up on a ...

  3. Spring与Quartz的整合实现定时任务调度(转)

    源:http://kevin19900306.iteye.com/blog/1397744 最近在研究Spring中的定时任务功能,最好的办法当然是使用Quartz来实现.对于一个新手来说,花了我不少 ...

  4. mac安装mongodb

    一,安装方法1 ,下载mongodb 1,官网下载mongodb程序 https://www.mongodb.org/downloads#production​ 2,解压后启动mongodb服务 下载 ...

  5. ajax异步提交数据动态更改select选项

    <!DOCTYPE html> <html> <head> <title></title> <script src="../ ...

  6. CSS3属性选择通配符

    CSS3增加了更多的CSS选择器,可以实现更简单但是更强大的功能,比如:nth-child()等. Attribute selectors:在属性中可以加入通配符,包括^,$,* [att^=val] ...

  7. IE hack

    .hack{ color:#fff;background:#; background:#06f\; /* all IE */ background:#\; /* IE8-9 */ background ...

  8. 使用text存储hash类型的数据 Use text filed to store the hash map

    在component表里用text类型的字段存储hash数据 (1)新建字段 ,这是migration的内容 class AddHintsToComponents < ActiveRecord: ...

  9. [POJ1068]Parencodings

    [POJ1068]Parencodings 试题描述 Let S = s1 s2...s2n be a well-formed string of parentheses. S can be enco ...

  10. 剑指Offer 二维数组中的查找

    题目描述 在一个二维数组中,每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序.请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数. 思路法一: * 矩阵是 ...