Unable to start pty process: - c++

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!

Worked solution for me :
Netbeans : File-> Project properties -> Run -> Console type -> External Terminal

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

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

Related

C++ Netbeans No output for very simple program

I am working on a program for a class. Yesterday my progress so far was working.
Today my output shows nothing. I've been working at trying to find the problem - and concluded that something must have happened in NetBeans. Below is a program that I made just to test this - this is not my class project (I wish it were this simple).
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char** argv) {
cout<<"anything"<<endl;
return 0;
}
if I go to run>test project I receive the following output:
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory '/cygdrive/c/Users/Pietzyk/Desktop/School/CSCI455/labs/NumsTester/cPlusTribulation'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/Cygwin-Windows/cplustribulation.exe
make[2]: Entering directory '/cygdrive/c/Users/Pietzyk/Desktop/School/CSCI455/labs/NumsTester/cPlusTribulation'
make[2]: 'dist/Debug/Cygwin-Windows/cplustribulation.exe' is up to date.
make[2]: Leaving directory '/cygdrive/c/Users/Pietzyk/Desktop/School/CSCI455/labs/NumsTester/cPlusTribulation'
make[1]: Leaving directory '/cygdrive/c/Users/Pietzyk/Desktop/School/CSCI455/labs/NumsTester/cPlusTribulation'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk SUBPROJECTS= .build-tests-conf
make[1]: Entering directory '/cygdrive/c/Users/Pietzyk/Desktop/School/CSCI455/labs/NumsTester/cPlusTribulation'
make[1]: *** No rule to make target '.build-tests-conf'. Stop.
make[1]: Leaving directory '/cygdrive/c/Users/Pietzyk/Desktop/School/CSCI455/labs/NumsTester/cPlusTribulation'
nbproject/Makefile-impl.mk:67: recipe for target '.build-tests-impl' failed
make: *** [.build-tests-impl] Error 2
BUILD TESTS FAILED (exit value 2, total time: 1s)
I do not know what any of this means. Although I'm assuming that the line with "*** No rule to make target" must be some sort of indicator as to my issue. I receive the same message with my class project.
When ran my output is:
RUN SUCCESSFUL (total time: 79ms)
if I go to run>test project
Test project requires you to actually have tests. You don't so that why your build is failing.
You should use Run / Run project or Build Project.
Or find this button .
As for the output: You have under Project properties (Right click project name). Choose the Run category. Here you have several options, Console type, where to direct cout.
As with most of my programming woes - such a simple fix:
Somewhere I must have fat-fingered something to where in the run>set main project I had changed what my main was.
Thanks Captain Giraffe for helping me trouble-shoot and get down to this problem.

Include <iostream> => Successfull Build, but no .exe (Netbeans)

I'm trying to compile this C++ code, but no luck. Using MinGW and Netbeans 7.4. The code doesn't make sense because I erased everything down to a minimum for failure analysis. The problem seems to be the line "#include ". When it's there, the project builds, but no .exe is created. If it's not there, the project builds and runs just fine.
Any ideas ? Btw, I read those other 'can't include
main.cpp
#include "xmessage.h"
using namespace std;
int main() {
xmessage();
return 0;
}
xmessage.cpp
#include <iostream> // What's wrooong with you, <iostream> !?!?
using namespace std;
void xmessage () {
int i = 1;
}
xmessage.h
#ifndef XMESSAGE_H
#define XMESSAGE_H
void xmessage ();
#endif /* XMESSAGE_H */
Also:
The files are .cpp, that's not it.
And if I remove the iostream file from the include folder
C:\MinGW\lib\gcc\mingw32\4.8.1\include\c++
the build fails. So that's definitely the file that is being used by the compiler.
Netbeans output:
"/C/MinGW/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make.exe[1]: Entering directory `/c/Users/admin/Documents/NetBeansProjects
/project125(HeaderFileMacros) - WIP'
"/C/MinGW/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk dist/Debug/MinGW-Windows
/project125_headerfilemacros__-_wip.exe
make.exe[2]: Entering directory `/c/Users/admin/Documents/NetBeansProjects
/project125(HeaderFileMacros) - WIP'
mkdir -p dist/Debug/MinGW-Windows
g++ -o dist/Debug/MinGW-Windows/project125_headerfilemacros__-_wip build/Debug/MinGW-Windows
/main.o build/Debug/MinGW-Windows/xmessage.o
make.exe[2]: Leaving directory `/c/Users/admin/Documents/NetBeansProjects
/project125(HeaderFileMacros) - WIP'
make.exe[1]: Leaving directory `/c/Users/admin/Documents/NetBeansProjects
/project125(HeaderFileMacros) - WIP'
BUILD SUCCESSFUL (total time: 4s)
Avast Antivir was in silent mode and it put every new .exe in quarantine without notifying me. That's why the .exe was instantly deleted after its creation.

Can't Compile Hello World in Netbeans

when I compile this program in Netbeans, the program shows the text in the output- What is it I'm doing wrong that causes this error and how do I fix it?
This is the Code I'm using:
/*
* File: main.cpp
* Author: Oliver
*
* Created on May 4, 2014, 12:33 AM
*/
#include <iostream>
using namespace std;
int main(int argc, char** argv) {
cout << "Hello World!";
return 0;
}
This is the results...:
"/C/MinGW/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make.exe[1]: Entering directory `/c/sers/Oliver/Documents/NetBeansProjects/Learning'
"/C/MinGW/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk dist/Debug/MinGW-Windows/learning.exe
make.exe[2]: Entering directory `/c/sers/Oliver/Documents/NetBeansProjects/Learning'
mkdir -p build/Debug/MinGW-Windows
make.exe[2]: mkdir: Command not found
make.exe[2]: *** [build/Debug/MinGW-Windows/main.o] Error 127
make.exe[2]: Leaving directory `/c/sers/Oliver/Documents/NetBeansProjects/Learning'
make.exe[1]: *** [.build-conf] Error 2
make.exe[1]: Leaving directory `/c/sers/Oliver/Documents/NetBeansProjects/Learning'
make.exe": *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 1s)
Look into your /C/MinGW/msys/1.0/bin/ for mkdir.exe .
if you found it there, you have not set your path environment variable to that folder.
C:\MinGW\msys\1.0\bin;C:\MinGW\bin;
So add it at the first place.
I apologize for the somewhat atypical picture. Binn currently working on a win2000 computer and can not switch.
If this is not enough, you can set manually "make.exe" into the C/C++ NetBeans Properties > Make Command textbox.
It's located in the path said in the previous answer.
C:\MinGW\msys\1.0\bin\make.exe

Cannot Compile "Hello World" in NetBeans IDE 7.3 with MinGW C++

I'm trying to make a simple "Hello World!" program in NetBeans IDE 7.3 with MinGW as my C++ compiler.
I'm getting build failures and I'm at a loss as to understanding why.
This is my compiler setup:
Family: MinGW
Base Directory: C:\MinGW
C Compiler: C:\MinGW\bin\gcc.exe
C++ Compiler: C:\MinGW\bin\g++.exe
Assembler: C:\MinGW\bin\as.exe
Make Command: C:\MinGW\msys\1.0\bin\make.exe
Debugger Command: C:\MinGW\bin\gdb.exe
I've made sure to that my environment PATH directs to C:\MinGW\bin and C:\MinGW\msys\1.0\bin.
My code is:
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World!" << endl;
return 0;
}
After trying to build the project, I recieve this message from the NetBeans debug output:
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory `/c/NetBeansProjects/HelloWorld'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/MinGW-Windows/helloworld.exe
make[2]: Entering directory `/c/NetBeansProjects/HelloWorld'
mkdir -p build/Debug/MinGW-Windows
rm -f build/Debug/MinGW-Windows/main.o.d
g++ -c -g -MMD -MP -MF build/Debug/MinGW-Windows/main.o.d -o build/Debug/MinGW-Windows/main.o main.cpp
make[2]: g++: Command not found
make[2]: *** [build/Debug/MinGW-Windows/main.o] Error 127
make[2]: Leaving directory `/c/NetBeansProjects/HelloWorld'
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory `/c/NetBeansProjects/HelloWorld'
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 1s)
I've search various Q&A, but I seem to be doing everything correctly.
Right click on My Computer and select properties. Click Advanced System Settings.System Properties dialog box will open. click Environmental Variables. Edit PATH variable and add C:\MinGW\msys\1.0\bin
Your settings on netbeans shoud be as follows
Base Directory: C:\MinGW\bin
C Compiler: C:\MinGW\bin\gcc.exe
C++ Compiler: C:\MinGW\bin\g++.exe
Fortran Compiler: C:\MinGW\bin\gfortran.exe
Assembler: C:\MinGW\bin\as.exe
Make Command: C:\MinGW\msys\1.0\bin\make.exe
Debbuger Command: C:\MinGW\bin\gdb.exe
Add these to your Environment variables
C:\MinGW\bin and C:\MinGW\msys\1.0\bin
This can happen if you have set the settings on netbeans before/during the time of installing MINGW and setting the environment PATH.
Just restart netbeans
you download mysys form mingw or sourceforge.net after install it, path is C:\Mysys\1.0\bin\make.exe to give the path into make compiler in netbean ide.

Can't Compile C++ Code on NetBeans 7.0

I just installed NetBeans 7.0 with C++ package. It asked for C++ compiler - I installed MinGW. I added it to NetBeans (so it recognize it). I think that it's all correct...
I wrote very simple C++ application in main.cpp and tried to compile it...
#include <cstdlib>
#include <iostream>
int main( int argc, char** argv ) {
std::cout << "Hello, world!";
return 0;
}
It complains about "Make Command" (under Tools -> Options -> C/C++ -> Build Tools). I tried to fix it and type C:\MinGW\msys\1.0\bin\make.exe in there. I tried to compile it again! Here's the error message...
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory `/c/Users/admin/Documents/C++/helloWorld'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/MinGW-Windows/helloworld.exe
make[2]: Entering directory `/c/Users/admin/Documents/C++/helloWorld'
make[2]: mkdir: Command not found
mkdir -p build/Debug/MinGW-Windows
make[2]: *** [build/Debug/MinGW-Windows/main.o] Error 127
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
make[2]: Leaving directory `/c/Users/admin/Documents/C++/helloWorld'
make[1]: Leaving directory `/c/Users/admin/Documents/C++/helloWorld'
BUILD FAILED (exit value 2, total time: 2s)
How to fix it and configure NetBeans (with C++ package) correctly?
I guess you didn't add msys to your PATH variable. See this entry in the Netbeans forum, as the error reported there is essentially the same as the one you pasted in your question. So, the error message you received does not complain about make, it complains that it can't find mkdir, which is supposed to be in a directory in your msys directory. Adding C:\MinGW\msys\1.0\bin\ to your windows PATH variable will probably be sufficient to fix this.
mkdir in Cygwin may be a separate .exe instead of a function of bash. So you may be just missing it for some reason.
"Resolve Missing Native Build Tools" Netbeans Make command problem. Go to -Tools -Options -C/C++ Write to Make Command: C:\MinGW\msys\1.0\bin\make.exe
Solution
Copy mingw32-make.exe from MinGW\bin\ to msys folder, replacing make.exe
not sure why this is necessary but, hey, it worked.