首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >VisualStudio2017,C++,在遍历代码时指出了错误的行

VisualStudio2017,C++,在遍历代码时指出了错误的行
EN

Stack Overflow用户
提问于 2017-08-25 16:58:19
回答 2查看 3.6K关注 0票数 12

在某些文件中,调试器在遍历代码时指向错误的行。准确地说,它是由严格的一行(总是)。

我已经尝试过的是:

代码语言:javascript
复制
1) normlized line-endings in all of the files
2) wiped out all of the PDB files
3) wiped out the entire debug folder
4) rebuilt the entire project
5)ensured that optimisation for the entire solution and projects within it it is turned-off (/Od switch enabled)
6)ensured that libraries (*.LIB) to which source code I have access to, have had their optimisation disabled and use the same threading mode as the main executable.
7) rebooted PC / VS

项目设置为x64调试,使用SQLite3 LIB和DLL、OpenCL.lib

错误文件中的示例:

代码语言:javascript
复制
   int a = 0;
   a++;
=> a++; //debugger points at this line, though the value of 'a' is already equal to 2
   a++;

一个文件有问题,而另一个文件可能没有问题。我还没有发现受影响的文件和它们的内容之间有任何关联。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2017-08-25 20:18:12

结果,我使用了stack post中描述的最受欢迎的方法来“规范化”整个项目中的行尾。好像没起作用。在用Visual规范行结束后,一切都很好。

因此,对于任何有此问题的其他人,只要重新启用自动行结束修复(如果禁用的话),就可以转到Tools=>Options=>Environment=>Documents并启用“检查负载上的行尾”。然后修复有问题的文件。

票数 12
EN

Stack Overflow用户

发布于 2021-08-12 19:14:06

在我的例子中,我发现实际上需要关闭项目,然后删除主exe项目文件夹和任何dll项目文件夹中的binobj文件夹。Visual将在下一次打开解决方案时自动重新创建空的binobj文件夹。在这一点上,重建项目将修复这个问题。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45886261

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档