C++添加新函数导致的运行时错误(除了其定义之外从未使用过)
这让我有点难受。我有一个用 C++ 编写的类。 一切正常。 接下来,我将函数 void A();
添加到头文件中并运行,它仍然可以正常工作。
然而,一旦我向 CPP 文件添加新的函数定义,我每次都会收到运行时错误。 (具体来说:进程终止,状态为 -1073741510(0 分 7 秒)
<代码> void 类名::A() { }
我在 Windows 上使用 Code::Blocks 运行,也很奇怪,但输出目录的权限在崩溃后全部更改,并且文件夹/文件全部设置为只读。
注意:代码中其他地方没有对该函数的引用/使用,只有定义。我感兴趣的是哪种错误可能会导致这种运行时错误?可能是某处内存泄漏?
This has been stumping me for a bit. I have a Class written in C++.
Everything works fine.
Next, I add function void A();
to the header file and run, It still works fine.
However as soon as I add a new function definition to the CPP file, I get a runtime error every single time. (specifically: Process terminated with status -1073741510 (0 minutes, 7 seconds)
void ClassName::A() {
}
I am running using Code::Blocks on Windows, also strange but the permissions of the output directory are all changed after the crash and the folders/files are all set to Read Only.
Note: there are NO references/uses of the function elsewhere in the code, only the definition. I am interested in what sort of bug could cause this kind of runtime error? Possibly a memory leak somewhere?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
通常此类错误是程序中某处内存损坏的结果。
Usually such an error is the result of memory corruption somewhere in the program.
听起来你在某处有一个野指针。
Sounds like you have a wild pointer somewhere.