3

When I build my code in C++ using NetBeans.

"make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
 make[1]: Entering directory '/cygdrive/c/Users/Alex/Documents/NetBeansProjects/test'
"make"  -f nbproject/Makefile-Debug.mk dist/Debug/Cygwin_4.x-Windows/test.exe
 make[2]: Entering directory '/cygdrive/c/Users/Alex/Documents/NetBeansProjects/test'
 make[2]: 'dist/Debug/Cygwin_4.x-Windows/test.exe' is up to date.
 make[2]: Leaving directory '/cygdrive/c/Users/Alex/Documents/NetBeansProjects/test'
 make[1]: Leaving directory '/cygdrive/c/Users/Alex/Documents/NetBeansProjects/test'
 BUILD SUCCESSFUL (total time: 652ms)

When I run my code in C++ using NetBeans...

 Unable to start pty process: 
 RUN FAILED (exit value -2, total time: 26ms)

My Code

 #include <iostream>
 using namespace std;
 int main(int argc, const char *argv[]) {
 cout << "Hello, World!\n";
 return 0;
 }

Help appreciated!

Alex Webber
  • 93
  • 2
  • 10
  • 1
    Likely, that's not the problem with your code, but rather with the environment – user3159253 Dec 04 '14 at 02:14
  • Possible duplicate of [Can build, but can't run C code in netbeans (but it works in command line)](http://stackoverflow.com/questions/18049467/can-build-but-cant-run-c-code-in-netbeans-but-it-works-in-command-line) – EricRobertBrewer Jan 26 '16 at 06:13

3 Answers3

9

Worked solution for me :

Netbeans :

File-> Project properties -> Run -> Console type -> External Terminal

vijay
  • 493
  • 5
  • 19
2

here's the corresponding Netbeans bug https://netbeans.org/bugzilla/show_bug.cgi?id=234221 People tell that the "use of external terminal" option may help

user3159253
  • 16,836
  • 3
  • 30
  • 56
0

I've changed the run compiler under project properties - run from c++ (what it says actually) to g++. Plus the "external terminal" it worked.

Uwe
  • 1