C++添加新函数导致的运行时错误(除了其定义之外从未使用过)

发布于 2024-09-12 07:55:46 字数 348 浏览 13 评论 0原文

这让我有点难受。我有一个用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

帅气称霸 2024-09-19 07:55:46

通常此类错误是程序中某处内存损坏的结果。

Usually such an error is the result of memory corruption somewhere in the program.

无所的.畏惧 2024-09-19 07:55:46

听起来你在某处有一个野指针。

Sounds like you have a wild pointer somewhere.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文