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

(一个简单的小程序)
#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. Kmeans算法的K值和聚类中心的确定

    0 K-means算法简介 K-means是最为经典的基于划分的聚类方法,是十大经典数据挖掘算法之一. K-means算法的基本思想是:以空间中k个点为中心进行聚类,对最靠近他们的对象归类.通过迭代的 ...

  2. 关于Mysql错误:./bin/mysqld_safe --user=mysql& [1] 32710 121003 16:40:22 mysqld_safe Logging to '/var/log/mysqld.log'. 121003 16:40:22 mysqld_s

    [root@www]# ./bin/mysqld_safe --user=mysql&[1] 32710[root@www]# 121003 16:40:22 mysqld_safe Logg ...

  3. jQuery 学习之路(2):选择器与过滤器

    一.基本选择器 标签选择器: $('button') ID选择器: $('#id1') 类选择器: $('.class1') 多重选择器: $('#id1,.class1,button') 全体选择器 ...

  4. grep之字符串搜索算法Boyer-Moore由浅入深(比KMP快3-5倍)

    这篇长文历时近两天终于完成了,前两天帮网站翻译一篇文章“为什么GNU grep如此之快?”,里面提及到grep速度快的一个重要原因是使用了Boyer-Moore算法作为字符串搜索算法,兴趣之下就想了解 ...

  5. 通过Canvas及File API缩放并上传图片完整示例

    <!DOCTYPE html> <html> <head> <title>通过Canvas及File API缩放并上传图片</title> ...

  6. MainData仿Backbone Model式 数据模型记录器

    MainData仿Backbone Model式 数据模型记录器主要思想:将 数据记录处理 和 因为数据变化而产生的页面渲染 两者解耦, 让页面元素可以与数据进行关联绑定,杜绝因为遗忘或是逻辑复杂导致 ...

  7. U盘操作系统,Kali Linux操作系统安装

    为什么要用U盘装操作系统,那好处多了去了.1.随身携带,想用就用.2.平常娱乐还是用Windows比较方便,不用做双系统那么麻烦. 准备: U盘,从天猫上买了个三星闪存盘,32G,USB3.0: 从官 ...

  8. PHP 暂停函数 sleep() 与 usleep() 的区别

    在PHP中暂停代码执行一定时间,有两个函数可以实现,一个是sleep(),另一个是usleep(),它们参数都是一个整数值.sleep()是暂停多少秒,usleep()是暂停多少微秒. 注意:usle ...

  9. debian8 配置使用 nfs

    操作过的步骤: 1.dpkg-reconfigre rpcbind. 2.在终端上退出要挂载的目录. 错误:mount -t nfs 172.16.0.121:/home/junda /mnt,出现以 ...

  10. PYTHON 迭代器

    可以走直接作用于for循环的对象统称为可迭代对象使用:Iterable 使用isinstance()判断一个对象是否是Iterable对象: from collections import Itera ...