Eclipse-C / C ++< terminate,exit value:-1073741515> [英] Eclipse- C/C++ <terminated, exit value: -1073741515>

查看:1241
本文介绍了Eclipse-C / C ++< terminate,exit value:-1073741515>的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近决定学习C / C ++准备一个编程类,我将需要几个月,所以我下载并安装Eclipse。当我经历HelloWorld项目的教程时,我遇到了一个问题,即使代码编译完全正常,控制台不会输出HelloWorld!。当我运行调试器,它说,它被终止,退出值是-1073741515,其次是我的目录C:\Users\Example\workspace\HelloWorld\Debug\HelloWorld.exe,然后日期和时间。

I recently decided to learn C/C++ in preparation for a coding class I will take in a few months so I downloaded and installed Eclipse. When I was going through the tutorials for the HelloWorld project, I ran into a problem where even though the code compiled perfectly fine, the console would not output "HelloWorld!" When I ran the debugger, it said that it was terminated and that the exit value was -1073741515 followed by my directory "C:\Users\Example\workspace\HelloWorld\Debug\HelloWorld.exe" followed by the date and time.

我安装了MinGW,我将eclipse的路径设置为C:\MinGW\bin,它在我的目录中,并检查确保我的首选项是正确的,因为在此之前,我有一些程序g ++找不到PATH和程序gcc找不到PATH这些错误是固定的,当我改变环境变量。

I installed MinGW and I set my path for eclipse to C:\MinGW\bin which is where it is in my directory and I checked to make sure my preferences were right because prior to this I was having some "program g++ not found in PATH" and "program gcc not found in PATH" These errors were fixed when I changed the environment variables.

当我继续遵循本教程,以及包含此代码的HelloWorld.cpp

When I continued to follow the tutorial, along with the HelloWorld.cpp which contained this code

#include <iostream>
using namespace std;

int main() {
    cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!
    return 0;
}



接下来,他们告诉我写一个main.cpp, / p>

Next, they told me to write a main.cpp which contained this code

#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以帮助构建和运行包含以下代码的项目:

Finally, they told me to create a makefile to help build and run my project which contained this code:

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我真的很困惑,为什么这是。有人可以帮助我吗?谢谢大家。

What this program should be doing is just printing out "HelloWorld!" five times in the console, but it is not and is just returning the "terminated, exit value: -1073741515" I'm really confused as to why this is. Can someone please help me? Thank you all.

推荐答案

您的路径设置可能不会传递到您的工具链。要确保,请将您的MinGW二进制文件夹的完整路径添加到Windows路径并重新启动。 (Cygwin二进制文件夹(C:\Cygwin64 \bin,在我的系统上)为Cygwin用户)。

Your path settings may not be carrying through to your toolchain. To be sure, add the full path to your MinGW binaries folder to your Windows path and restart. (Cygwin binaries folder (C:\Cygwin64\bin, on my system) for Cygwin users).

这篇关于Eclipse-C / C ++&lt; terminate,exit value:-1073741515&gt;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆