C++ Netbeans No output for very simple program - c++

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.

Related

NetBeans Make Command when using MinGW

I'm trying to use NetBean to program C++, I have followed each of the
commands found here:
https://netbeans.org/community/releases/68/cpp-setup-instructions.html#compilers_windows
However, I am having trouble with the make command option in netbeans. I have set the base directory o M:\c++\bin, where I have MinGW installed, and I have the make command set to M:\MinSYS\bin\make.exe, but when trying to build a simple program, netbeans produces the following error:
"/M/c++/MinSYS/bin/make.exe" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make.exe[1]: Entering directory `/m/Documents/NetBeansProjects/CppApplication_1'
"/M/c++/MinSYS/bin/make.exe" -f nbproject/Makefile-Debug.mk dist/Debug/MinGW-Windows/cppapplication_1.exe
make.exe[2]: Entering directory `/m/Documents/NetBeansProjects/CppApplication_1'
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 `/m/Documents/NetBeansProjects/CppApplication_1'
make.exe[1]: *** [.build-conf] Error 2
make.exe[1]: Leaving directory `/m/Documents/NetBeansProjects/CppApplication_1'
make.exe": *** [.build-impl] Error 2
I have tried changing the make command to anything with make in it, but neither get anywhere, any help would be massively appreciated.
When using MinGW it is said that mingw make is not supported, so install MSYS make utility from MinGW and update in build tools make command as shown in below picture, hope it helps.
Installation of MSYS make
Update make command
I ran into the same problem. Saw the answer on another post and it fixed the issue. Make sure to restart NetBeans after doing the following:
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

Unable to start pty process:

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.

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

Error in C++ netbeans mkdir not found?

Everytime I try to build my c++ file I get this error
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory `/c/Users/Joey/Documents/NetBeansProjects/C++Train'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/MinGW-Windows/c__train.exe
make[2]: Entering directory `/c/Users/Joey/Documents/NetBeansProjects/C++Train'
make[2]: mkdir: Command not found
mkdir -p build/Debug/MinGW-Windows
make[2]: Leaving directory `/c/Users/Joey/Documents/NetBeansProjects/C++Train'
make[1]: Leaving directory `/c/Users/Joey/Documents/NetBeansProjects/C++Train'
make[2]: *** [build/Debug/MinGW-Windows/HelloWorld.o] Error 127
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 2s)
I checked the directory the make.exe was in and mkdir was there so I'm just baffled.
my code itself shows no errors:
#include <iostream>
int main() {
using namespace std;
cout << "Hello World!" << endl;
return 0;
}
Just a simple little hello world to test netbeans.
I guess you didn't add msys to your PATH variable. See this entry in the Netbeans forum(http://forums.netbeans.org/topic38061.html) 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.

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.