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

(一个简单的小程序)
#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. php 选择排序法

    private function demo(array $arr = array()){ $len = count($arr); if ($len == 1) return $arr; else fo ...

  2. Mastering Web Application Development with AngularJS 读书笔记-前记

    学习AngularJS的笔记,这个是英文版的,有些地方翻译的很随意,做的笔记不是很详细,用来自勉.觉得写下来要比看能理解的更深入点.有理解不对的地方还请前辈们纠正! 一.关于<Mastering ...

  3. svn cleanup failed–previous operation has not finished; run cleanup if it was interrupted

    svn cleanup failed–previous operation has not finished; run cleanup if it was interrupted (2014-08-1 ...

  4. XML理解

    XML:页面之间传递数据,跨平台传递,核心标签 HTML:超文本标记语言,核心标签 <xml version='1.0'>版本1.0<Nation> <one> & ...

  5. 关于hibernate链接数据源的配置参数详细解释(转)

    具体使用方法还可以参考以下地址: http://blog.csdn.net/xb12369/article/details/41517409 以下信息转自: http://baike.baidu.co ...

  6. SQL双重游标(双重循环)--笔记

    declare )='', )='', )='' --创建游标 declare @cursor cursor --设定游标欲操作的数据集 set @cursor=cursor for select s ...

  7. 【转】JavaScript面向对象

    http://www.cnblogs.com/dolphinX/p/4385862.html 理解对象 对象这个词如雷贯耳,同样出名的一句话:XXX语言中一切皆为对象! 对象究竟是什么?什么叫面向对象 ...

  8. css小常识

    static:对象遵循常规流.此时4个定位偏移属性不会被应用(即 没有声明position:relative, top.right.bottom.left不管用). 当position的值为非stat ...

  9. sql执行顺序

    SQL 不同于与其他编程语言的最明显特征是处理代码的顺序.在大数编程语言中,代码按编码顺序被处理,但是在SQL语言中,第一个被处理的子句是FROM子句,尽管SELECT语句第一个出现,但是几乎总是最后 ...

  10. 剑指Offer 找出字符串中第一个只出现一次的字符

    题目描述 找出字符串中第一个只出现一次的字符 如果无此字符 请输出'.' 输入描述: 输入一串字符,由小写字母组成 输出描述: 输出一个字符 输入例子: asdfasdfo 输出例子: o 思路:数组 ...