MinGW完全侵入NetBeans

MinGW完全侵入NetBeans

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

问题描述

以下代码不会产生错误:

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

using namespace std;

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

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

解决方案

我建议使用


  • 我希望这也能帮助其他人。 p>




    与您的问题无关::

      #include< iostream> 

    int main(int argc,char ** argv){
    int n;
    std :: cin>> n;
    std :: cout<< n;

    return 0;
    }


    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 ;
        }
    

    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?

    解决方案

    I recommend using MinGW Distro if you want to develop C++ under a Microsoft Windows operating system. It ships with a pretty new GCC version and with the Boost libraries.

    NetBeans IDE is pretty picky regarding the build environment settings. E.g. It doesn't work together with all versions of make (we have to distinct make.exe from MSYS and mingw32-make.exe from MinGW for example) and there are problems regarding the used Java Runtime Enviroment (JRE).

    With the settings shown in the following screenshot you should be able to build your example with MinGW Distro and NetBeans 8. I recommend to not configure a absolute path to the make.exe file but add that path to your Microsoft Windows environment variable PATH. Otherwise you may get build errors.

    Maybe these two blog posts help if you want to use the "default" MinGW distribution:

    1. Installing Minimum GNU for Windows (MinGW)
    2. Configure NetBeans IDE for Minimum GNU for Windows (MinGW)

    I hope this helps others as well.


    Not related to your question: Don't use using namespace std:

    #include <iostream>
    
    int main(int argc, char** argv) {
      int n;
      std::cin >> n;
      std::cout << n;
    
      return 0;
    }
    

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

    08-26 08:03