Error in C++ netbeans mkdir not found? - c++

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.

Related

NetBeans building failure | make Error 1

I get the following errors while building my project (game with C++/SFML):
cd '/home/osboxes/NetBeansProjects/Prueba'
/usr/bin/make -f Makefile CONF=Debug
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory '/home/osboxes/NetBeansProjects/Prueba'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux/prueba
make[2]: Entering directory '/home/osboxes/NetBeansProjects/Prueba'
mkdir -p dist/Debug/GNU-Linux
g++ -o dist/Debug/GNU-Linux/prueba build/Debug/GNU-Linux/AABBCollidable.o build/Debug/GNU-Linux/AABBCollisionDetector.o build/Debug/GNU-Linux/AnimatedSprite.o build/Debug/GNU-Linux/Animation.o build/Debug/GNU-Linux/ConvexCollidable.o build/Debug/GNU-Linux/ConvexCollisionDetector.o build/Debug/GNU-Linux/ConvexShape.o build/Debug/GNU-Linux/Director.o build/Debug/GNU-Linux/Entry.o build/Debug/GNU-Linux/Event.o build/Debug/GNU-Linux/EventManager.o build/Debug/GNU-Linux/FileLogger.o build/Debug/GNU-Linux/GuiElement.o build/Debug/GNU-Linux/GuiSystem.o build/Debug/GNU-Linux/Label.o build/Debug/GNU-Linux/LabelButton.o build/Debug/GNU-Linux/ResourceManager.o build/Debug/GNU-Linux/State.o -L/usr/lib/x86_64-linux-gnu -lsfml-window -lsfml-system -lsfml-graphics -lsfml-audio
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o: In function `_start':
collect2: error: ld returned 1 exit status
nbproject/Makefile-Debug.mk:79: recipe for target 'dist/Debug/GNU-Linux/prueba' failed
make[2]: *** [dist/Debug/GNU-Linux/prueba] Error 1
make[2]: Leaving directory '/home/osboxes/NetBeansProjects/Prueba'
nbproject/Makefile-Debug.mk:76: recipe for target '.build-conf' failed
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory '/home/osboxes/NetBeansProjects/Prueba'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 2s)
I have installed NetBeans IDE 8.1 with SFML libraries. I tried to fix it by clearing cache from NetBeans and then restart IDE but still does the same errors.
My project was compiled with Standard C++ compiler (C++11 version).
Hope you could help me. Thanks by the way...

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.

Unable to build NetBeans C/C++ Project

I just can't build a C/C++ project in NetBeans. The environment variable is properly set.
Error :
"/C/MinGW/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make.exe[1]: Entering directory `/c/Users/Rahul/Documents/NetBeansProjects/CppApplication_1'
"/C/MinGW/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk dist/Debug/MinGW-Windows/cppapplication_1.exe
make.exe[2]: Entering directory `/c/Users/Rahul/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 `/c/Users/Rahul/Documents/NetBeansProjects/CppApplication_1'
make.exe[1]: *** [.build-conf] Error 2
make.exe[1]: Leaving directory `/c/Users/Rahul/Documents/NetBeansProjects/CppApplication_1'
make.exe": *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 2s)
Code :
#include <stdio.h>
int main(void) {
printf("hello");
return 0;
}
NetBeans-1 :
NetBeans-2 :
The problem is that the "make" from msys looks for the msys mkdir but can't find it because you are not running in an msys environment.
The safe way to solve this is to launch NetBeans from the msys shell.
Alternatively you can manually create the directory as gcc/g++/... itself is also found on the path outside of an msys environment.

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

Netbeans Building Issues for C++

I'm using the MinGW complier/make/etc files but whenever I try to run my code it spits this back out to me:
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory `/c/Users/Geneva/workspace/C++ Through Game Programming'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/MinGW-Windows/c___through_game_programming.exe
make[2]: Entering directory `/c/Users/Geneva/workspace/C++ Through Game Programming'
mkdir -p dist/Debug/MinGW-Windows
g++ -o dist/Debug/MinGW-Windows/c___through_game_programming build/Debug/MinGW-Windows/diceroll.o build/Debug/MinGW-Windows/main.o
build/Debug/MinGW-Windows/main.o: In function `main':
C:\Users\Geneva\workspace\C++ Through Game Programming/main.cpp:35: multiple definition of `main'
build/Debug/MinGW-Windows/diceroll.o:C:\Users\Geneva\workspace\C++ Through Game Programming/diceroll.cpp:16: first defined here
collect2: ld returned 1 exit status
make[2]: *** [dist/Debug/MinGW-Windows/c___through_game_programming.exe] Error 1
make[2]: Leaving directory `/c/Users/Geneva/workspace/C++ Through Game Programming'
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory `/c/Users/Geneva/workspace/C++ Through Game Programming'
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 1s)
I have my environment variable PATH set right, when I installed the gbd I just extracted it to the normal C:\MinGW\bin so that I wouldn't have to do C:\MinGW\msys\1.0\bin
Can anyone help out? If I can't figure this out I'm going to go back to coding in Java
The compiler message is clear: You have defined multiple main() functions