Visual Studio 2017,C++,在单步执行代码时指向错误的行
Visual Studio 2017, C++, pointing a wrong line while stepping through the code
在某些文件中,调试器在单步执行代码时指向错误的行。准确地说,它完全偏离了一行(总是(
我已经尝试过:
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
错误文件中的示例:
int a = 0;
a++;
=> a++; //debugger points at this line, though the value of 'a' is already equal to 2
a++;
一个文件有问题,而另一个文件可能没有问题。我没有发现受影响的文件与其内容之间存在任何相关性。
事实证明,我使用了中描述的最赞成的方法 堆栈帖子 "规范化"整个项目中的行尾。好像没用。 在使用Visual Studio规范化行尾后,一切正常。
因此,对于遇到此问题的其他任何人,只需重新启用自动行尾修复,如果禁用,请转到 Tools=>Options=>Environment=>Documents 并启用"在加载时检查一致的行尾"。然后重新处理有问题的文件。
就我而言,我发现我实际上需要关闭项目,然后删除主exe项目文件夹和任何dll项目文件夹中的bin
和obj
文件夹。Visual Studio 将在下次打开解决方案时自动重新创建空bin
和obj
文件夹。此时,重新生成项目将解决此问题。
相关文章:
- 错误处理.将系统错误代码映射到泛型
- 为什么我在使用void函数时得到错误代码C2276
- 尝试链接我的着色器时,我收到错误代码"error c5145 must write to gl_position"
- 逻辑运算符上出现错误代码 a')'
- 'val' Arduino 错误代码之前的预期'('
- 我在贪吃蛇游戏中收到了错误代码 -1073741571
- 根据 GetLastError 直接写入磁盘会导致错误代码 5
- 当我选择大于 720 的矩阵大小时,程序退出并显示错误代码.可能是什么原因?
- 创建进程 API 失败,在窗口 122 上出现错误代码 10
- 使用另一个函数调用一个函数(都在类中)时出现问题.没有错误代码C++
- 当命令失败时,gzip 会在 C++ 中返回错误代码吗?
- 从 C++ 调用 cURL 命令会返回意外的错误代码,如 1792 和 6656
- WSALookupServiceBegin() 上的错误代码 10022(无效的 arugment)
- C++ Schannel POST 400 错误代码错误请求
- openCL-创建子缓冲区返回错误代码13
- 更新了Runge-Kutta(RK4)C++错误代码中的二阶DE
- 获取有关使用未初始化内存的错误代码
- 排序程序的意外错误代码
- 正在将DJI错误代码记录到流中
- 来自API的错误代码..处理什么是好的做法