0

I'm trying to make this work with Netbeans+MinGW. It says run failed. I tried to do step by step and came up with this little code:

#include <iostream>
#include <string>

using namespace std;

int main(int argc, char** argv) {
    string input = "";
    return 0;
}

I'm getting RUN FAILED (exit value 57, total time: 364ms). Here I read that not use using namespace std;. I tried that way too, but still run failed. What is the problem? How to use string without run failed?

14
  • does it work without string input = ""; ? Commented Jan 27, 2017 at 14:12
  • @George Yes, it does. Commented Jan 27, 2017 at 14:14
  • 3
    This can't normally fail, so you most likely have either your compiler (MinGW) or IDE (NetBeans) setup wrong. Might be incomplete MinGW installation - did you install using the provided installer, or manually from zip archives? E.g. string might be using libraries (locale etc.) which you didn't install properly (missing, wrong version etc.). Commented Jan 27, 2017 at 14:15
  • Maybe it's a bug in netbeans? Commented Jan 27, 2017 at 14:16
  • 1
    @SimonÁdám you can fix that error with this link Commented Jan 27, 2017 at 14:55

1 Answer 1

4

In my experience, it would take forever and a waste of time to figure these problems out. A simple solution is trying other IDE. For C++, try Code Block or Visual Studio Express. I did have a lot of weird errors with string library in Code Block, but in Visual Studio it runs well. The problem was that there are some errors in Code Block itself.

Sign up to request clarification or add additional context in comments.

2 Comments

As far as Visual Studio is concerned, you can now even try the new 2017 version which has a completely new compiler flag for improved ISO conformance to replace the old /Za flag which never worked right with standard and/or Windows headers.
Although we found a solution now, I keep your advice and move to Visual Studio, because other problems can occur. And I don't have days to find a solution for every bloomer like this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.