BUILD FAILED Netbeans 7.4 C / C++ - c++

I am trying to fix my Netbeans IDE to compile C / C++ programs, but I get the following error:
"/D/MinGW/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make.exe[1]: Entering directory `/c/Users/MOTIVECODEX/Documents/NetBeansProjects/make'
"/D/MinGW/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk dist/Debug/MinGW_TDM-Windows/make.exe
make.exe[2]: Entering directory `/c/Users/MOTIVECODEX/Documents/NetBeansProjects/make'
mkdir -p build/Debug/MinGW_TDM-Windows
make.exe[2]: mkdir: Command not found
make.exe[2]: *** [build/Debug/MinGW_TDM-Windows/main.o] Error 127
make.exe[2]: Leaving directory `/c/Users/MOTIVECODEX/Documents/NetBeansProjects/make'
make.exe[1]: *** [.build-conf] Error 2
make.exe[1]: Leaving directory `/c/Users/MOTIVECODEX/Documents/NetBeansProjects/make'
make.exe": *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 1s)
I have added these to my windows user variables path and also system variables path:
D:\MinGW\bin; D:\MinGW\msys\1.0\bin; D:\MinGW\mingw32\bin;
But still getting this error.
I am using MinGW with MSYS with Netbeans IDE 7.4. Windows 7 64 bit.
I have reïnstalled both MinGW MSYS and Netbeans IDE 7.4. NetBeans IDE 7.4 has C / C++ installed.
Paths in Netbeans:
I know this is a duplicate, but those "solutions" did not work, so
spare me the trouble of marking this as duplicate.

Solution to my problem: Remove MinGW and ALL of it's components, and also remove the folder x:\MinGW. Then install Cygwin, choose the packages you need, tutorial can be found on https://netbeans.org/community/releases/73/cpp-setup-instructions.html#cygwin or YouTube about which packages you need. Then add x:\cygwin to your system path, in my case D:\cygwin64 and reopen Netbeans, go to tools -> options -> C/C++ and click on Restore Defaults. It changed everything to cygwin, in my case cygwin64, and I can build now without errors.

I am making this post about a problem that I encounter when I made a clean and build on a C language program. There was a post about the same problem for a C++ program pointing towards a problem with the main function. This post and the message from the clean and build lead me toward a solution.
When you create a new project:
Categories: C/C++
Projects: C/C++ Application
After you click on Next you should uncheck the Create Main File box before proceeding. You should not have any problems afterward.

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

Build error while building Nodejs on Cygwin

I need some help compiling Node source code on cygwin. Every time I try to make the build, it throws the following error message. I am using Windows 8 and Cygwin 1.7.28. I have tried installing YASM. Please help!
python tools/gyp_node -f make
make -C out BUILDTYPE=Release V=1
make[1]: Entering directory '/home/vineet/node-v0.8.22/out'
*LD_LIBRARY_PATH=/home/vineet/node-v0.8.22/out/Release/lib.host:/home/vineet/node-v0.8.22/out/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../deps/openssl; mkdir -p /home/vineet/node-v0.8.22/out/Release/obj.target/openssl/geni; ml64.exe /Zi /Fo "/home/vineet/node-v0.8.22/out/Release/obj.target/openssl/geni/aes-x86_64.obj" /c "/home/vineet/node-v0.8.22/deps/openssl/asm/x64-win32-masm/aes/aes-x86_64.asm"
/bin/sh: ml64.exe: command not found
deps/openssl/openssl.target.mk:10: recipe for target '/home/vineet/node-v0.8.22/out/Release/obj.target/openssl/geni/aes-x86_64.obj' failed
make[1]: *** [/home/vineet/node-v0.8.22/out/Release/obj.target/openssl/geni/aes-x86_64.obj] Error 127
make[1]: Leaving directory '/home/vineet/node-v0.8.22/out'
Makefile:26: recipe for target 'node' failed
make: *** [node] Error 2*
Well, since it's complaining about ml64, you have to establish:
Do you actually have masm/x64 on your system? It's probably in a directory like C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\amd64\
Is your path set up within CygWin to reference that directory, so that the executable can be found?
By the error message:
/bin/sh: ml64.exe: command not found
it's almost certainly one of those two problems.
in fact , you can download a VC++ express from Microsoft, it is free. and just open a VC++ X86 Command Prompt, then simple execute VCbuild.bat, cygwin is useless in this case.

run error using MinGW with netbeans 7.3.1

I Installed MinGW and i'm using it with netbeans. However when i try to run a simple "Hello world" programm it gives me the following error:
"/C/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build- conf
make.exe[1]: Entering directory `/c/Users/Notandi/Documents/NetBeansProjects/somegame'
"/C/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk dist/Debug/MinGW_1- Windows/somegame.exe
make.exe[2]: Entering directory `/c/Users/Notandi/Documents/NetBeansProjects/somegame'
mkdir -p dist/Debug/MinGW_1-Windows
g++ -o dist/Debug/MinGW_1-Windows/somegame build/Debug/MinGW_1-Windows/main.o - lmingw32 -lSDL2main -lSDL2.dll
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot open output file dist/Debug/MinGW_1-Windows/somegame.exe: Permission denied
collect2.exe: error: ld returned 1 exit status
make.exe[2]: *** [dist/Debug/MinGW_1-Windows/somegame.exe] Error 1
make.exe[2]: Leaving directory `/c/Users/Notandi/Documents/NetBeansProjects/somegame'
make.exe[1]: *** [.build-conf] Error 2
make.exe[1]: Leaving directory `/c/Users/Notandi/Documents/NetBeansProjects/somegame'
make.exe": *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 3s)
I have checked if the program is running in background, but it isn't.
im using windows 64bit and using MinGW for c++.
I simply configured NetBeans to use MinGW and faced the same inconveniences, but soon simply
decided to use NetBeans with "Run as an administrator", which helped (and so even made "Run as an administrator" unnecessary in further runs). And on a next week I can reinstall MinGW + MSYS in another manner. I'm citing:
The NetBeans IDE might have issues when you try to build and run projects later if MSYS is installed under a limited user account

Netbeans C/C not compiling

I installed the NetBeans IDE 7.3.1 almost a week ago and still haven't been able to get it to compile anything.
I'm using the Cygwin's compiler for C/C++, and I get the following error message for a simple "Hello World" program:
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory `/cygdrive/c/Users/CaptFuzzyboots/Documents/NetBeansProjects/Hello World'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/Cygwin_1-Windows/hello_world.exe
make[2]: Entering directory `/cygdrive/c/Users/CaptFuzzyboots/Documents/NetBeansProjects/Hello World'
mkdir -p build/Debug/Cygwin_1-Windows
rm -f build/Debug/Cygwin_1-Windows/main.o.d
gcc -c -g -MMD -MP -MF build/Debug/Cygwin_1-Windows/main.o.d -o build/Debug/Cygwin_1-Windows/main.o main.c
make[2]: gcc: Command not found
nbproject/Makefile-Debug.mk:66: recipe for target `build/Debug/Cygwin_1-Windows/main.o' failed
make[2]: *** [build/Debug/Cygwin_1-Windows/main.o] Error 127
make[2]: Leaving directory `/cygdrive/c/Users/CaptFuzzyboots/Documents/NetBeansProjects/Hello World'
nbproject/Makefile-Debug.mk:59: recipe for target `.build-conf' failed
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory `/cygdrive/c/Users/CaptFuzzyboots/Documents/NetBeansProjects/Hello World'
nbproject/Makefile-impl.mk:39: recipe for target `.build-impl' failed
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 472ms)
EDIT
I fixed this by just making a new toolkit and adding the base directory as Cygwin -> bin.
The problem now is that I keep getting
Unable to start pty process
gcc: Command not found
You should check whether you have installed gcc (plus gdb and make)
via MinGW:
MinGW+NetBeans (just look at the screenshots, you don't have to understand Hungarian)
via Cygwin:
http://www.eecg.utoronto.ca/~aamodt/ece242/cygwin.html
You should also check whether paths are correct in NetBeans:
Tools > Options > C/C++ > Build Tools:
(At the time of creating the screenshot, I had MinGW installed in C:\Programs\MinGW, BUT if you have it installed in C:\MinGW (which is the default), this correct, too! The only important thing is that you should install MinGW in a path which doesn't contain whitespaces.)
This is what it looks like when paths are incorrect, letters are red:
Note: I have MinGW installed, but it doesn't change the fact that you should check whether YOUR paths are correct.
You should also take care the right Configuration is selected in project Properties (right click on project) > Build - The right "Tool collection" has to be selected (on which the paths above are correct):
Unable to start pty process
Related answer: Can build, but can't run C code in netbeans (but it works in command line)
So right click on the project, Properties > Run > Console Type > External Terminal (instead of e.g. "Internal Terminal"). Here is a screenshot:
Here is your problem:
gcc: Command not found
Cygwin is not a compiler, it's a unix-like environment for Windows. Gcc is the compiler. You have to install gcc with Cygwin before it will work.

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.