MinGW完全侵入NetBeans [英] MinGW completely bugged on NetBeans

查看:180
本文介绍了MinGW完全侵入NetBeans的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下代码不会产生错误:

The following code shoudn't produce an error:

    #include <cstdlib>
    #include <cstdio>
    #include <iostream>

    using namespace std ;

    int main ( int argc , char** argv )
    {
        int n ;
        cin >> n ;
        cout << n ;
        return 0 ;
    }

然而,得到一个运行失败(退出值-1,073,741,511,总时间: 46ms),而在Netbeans上运行MinGW / Msys。任何建议,如切换回Cygwin?

Yet a get a "RUN FAILED (exit value -1,073,741,511, total time: 46ms)" whilst running MinGW/Msys on Netbeans. Any advice like switching back to Cygwin?

推荐答案

我遇到了同样的问题(退出代码-1,073,741,511)

I ran into this same issue (with exit code -1,073,741,511), so though a dated question, I'm posting this here for anyone else who runs into the problem.


  1. 手动运行程序的可执行文件。您可能会收到一个错误,如过程入口点__gx_personality_v0 coud不能位于动态库libstdc ++ - 6.dll。 (OP已在注释中确认此情况。)

  2. 上述错误消息中引用的.dll文件未链接或链接不正确。需要链接的.dll的正确版本是... \MinGW\bin目录中的版本。在Windows中,您可以通过在命令提示符下键入其中libstdc ++ - 6.dll 来检查正在链接的.dll文件;列出的第一个结果将是链接的文件。如果你已经看到... \MinGW\bin\libstdc ++ - 6.dll作为第一个结果,我的修复下面不会帮助你。

  3. 如果你看到一条消息INFO:Could not find files for the given pattern(s)。,则... \MinGW\bin需要添加到%PATH%变量中。 (OP已经确认这不是问题。)

  4. 我遇到的问题是,我安装的程序有自己的(可能过期的)版本 libstdc ++ - 6.dll ,它位于我的%PATH%变量中的一个文件夹中,位于... \MinGW\bin之前。这意味着这个其他的.dll文件在执行期间被拾取并链接到。这可以通过编辑您的%PATH%变量来确定,以确保... \MinGW\bin条目在所有其他目录,也有一个版本的.dll文件。

  1. Run the executable for the program manually. You might get an error such as "the procedure entry point __gx_personality_v0 coud not be located in the dynamic library libstdc++-6.dll". (OP has confirmed this in a comment.)
  2. The .dll file referred to in the error message above is either not being linked, or linked incorrectly. The correct version of the .dll that needs to be linked is the one in the ...\MinGW\bin directory. In Windows, you can check the .dll file being linked by typing where libstdc++-6.dll in a command prompt; the first result that is listed will be the file that is linked. If you already see ...\MinGW\bin\libstdc++-6.dll as the first result here, my fix below will not help you.
  3. If you see a message "INFO: Could not find files for the given pattern(s).", then ...\MinGW\bin needs to be added to your %PATH% variable. (OP has already confirmed this was not the issue.)
  4. The issue I was having was that a program I had installed had its own (likely outdated) version of libstdc++-6.dll, which was in a folder also included in my %PATH% variable, ahead of ...\MinGW\bin. This meant that this other .dll file was being picked up and linked to during execution. This can be fixed by editing your %PATH% variable to make sure the ...\MinGW\bin entry is ahead of all other directories that also have a version of the .dll file.

编辑:另一个选项是静态链接.dll在程序编译,或将正确的.dll的副本放在程序可执行文件目录中。

The other option is to statically link the .dll at program compilation, or place a copy of the correct .dll in the program executable directory. However, neither of these fixes is 'global', and needs to be done for each project individually.

希望这会有帮助!

这篇关于MinGW完全侵入NetBeans的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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