Eclipse- C/C++ <终止,退出值:-1073741515>
Eclipse- C/C++ <terminated, exit value: -1073741515>
我最近决定学习C/c++,为几个月后的编程课做准备,所以我下载并安装了Eclipse。当我在浏览HelloWorld项目的教程时,我遇到了一个问题,即使代码编译得很好,控制台也不会输出"HelloWorld!"当我运行调试器时,它说它被终止,退出值是-1073741515,然后是我的目录"C:UsersExampleworkspaceHelloWorldDebugHelloWorld.exe",然后是日期和时间。
我安装了MinGW,我将eclipse的路径设置为C:MinGWbin,这是它在我的目录中的位置,我检查了以确保我的偏好是正确的,因为在此之前我有一些"程序g++未在path中找到"answers"程序gcc未在path中找到"这些错误在我更改环境变量时被修复。
当我继续遵循教程,以及包含以下代码的HelloWorld.cpp时
#include <iostream>
using namespace std;
int main() {
cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!
return 0;
}
接下来,他们让我写一个main.cpp,其中包含以下代码
#include <iostream>
using namespace std;
int main() {
// Say Helloworld five times
for (int index = 0; index < 5; ++index)
cout << "HellowWorld!" << endl;
char input = 'i';
cout << "To exit, press 'm' then the 'Enter' key." << endl;
cin >> input;
while(input != 'm') {
cout << "You just entered '" << input << "'. "
<< "You need to enter 'm' to exit." << endl;
cin >> input;
}
cout << "Thank you. Exiting." << endl;
return 0;
}
最后,他们告诉我创建一个makefile来帮助构建和运行我的项目,其中包含以下代码:
all: hello.exe
clean:
rm main.o hello.exe
hello.exe: main.o
g++ -g -o hello main.o
main.o:
g++ -c -g main.cpp
这个程序应该做的是在控制台中打印五次"HelloWorld!",但它不是,只是返回"终止,退出值:-1073741515",我真的很困惑为什么会这样。有人能帮帮我吗?谢谢大家。
我有一些使用Eclipse C/c++的经验
我建议的第一件事是你通过启动一个新项目来做一个测试,然后点击'new hello world'选项,而不是'empty project',这应该会设置你的所有项目。-当你完成这些后,你应该能够使用Eclipse中的按钮运行程序。
如果它工作,你就完成了-你可以修改程序到任何你想要的,一切都是为你做的。
如果它不起作用,则有问题,很可能是Eclipse找不到编译器。当您启动一个新项目时,您可能能够告诉它,因为它将在启动项目窗口的右侧显示它找到的编译器。
希望这对你有帮助。根据我的经验,Eclipse真的很棒,但是有太多的选项,它可能有点令人生畏,我知道我没有充分利用它的潜力。
如果你真的被困住了,试试使用PELLES而不是Eclipse——在我的经验中,这更容易上手。
您的路径设置可能没有传递到您的工具链。为了确保这一点,将MinGW二进制文件夹的完整路径添加到Windows路径中,然后重新启动。(Cygwin的二进制文件夹(C:Cygwin64bin,在我的系统中))
- 为什么"do while"循环不断退出,即使条件计算结果为 false?
- 创建LinkedList退出,返回代码为-11(SIGSEGV)
- 当我在main中声明了我的2d数组时,为什么我的程序会退出
- 如何让LLDB在成功时退出,在失败时等待
- C++控制台应用程序阻止退出
- 程序在执行程序的其余部分之前退出
- 构造函数在退出函数时无法初始化一个参数
- 为什么异常不退出程序?
- 我不断收到 [错误] ID 返回 1 退出状态错误,但看不到问题所在
- 退出简单while循环时出现问题
- 使用vscode调试时,GDB意外退出
- pclose() 不会给我进程退出代码
- 为什么系统函数总是在C++中返回已转移的退出状态?
- CLion、MinGW 和 SDL2:进程已完成,退出代码为 -1073741515 (0xC0000135)
- OpenGL 应用程序退出,退出代码为 -1073741515 (0xC0000135)
- CLION QT5-退出代码-1073741515(0xc0000135)
- 错误 MSB6006:"midl.exe"退出,代码为 -1073741515
- 链接 Visual C++ 项目 (VS 2010) 会导致错误MSB6006:"link.exe"退出代码1073741515
- 退出代码-1073741515
- Eclipse- C/C++ <终止,退出值:-1073741515>