Netbeans C / C does not compile

I installed NetBeans IDE 7.3.1 almost a week ago and still have not been able to compile it.
I use the Cygwin 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.od gcc -c -g -MMD -MP -MF build/Debug/Cygwin_1-Windows/main.od -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 simply creating a new toolkit and adding a base directory like Cygwin → bin.

Now the problem is that I keep getting

Unable to start pty process

+4
source share
2 answers

gcc: Command not found

  • You should check if you have gcc installed (plus gdb and make )

  • You should also check the correct paths in NetBeans:

    Tools> Options> C / C ++> Build Tools :

    (When creating the screenshot, I had MinGW installed in C:\Programs\MinGW , BUT if you installed it in C:\MinGW (this is the default value), this is also correct! The only important thing is that you have to install MinGW in paths that do not contain spaces.)

    NetBeans: Tools> Options> C / C ++> Build Tools

    This is what it looks like when the paths are wrong, the letters are red:

    NetBeans: Tools> Options> C / C ++> Build Tools, incorrect paths

    Note. I have MinGW installed, but this does not change the fact that you should check the correctness of your paths.

  • You must also ensure that the correct configuration is selected in Project Properties. (right-click on the project)> Build - the correct "collection of tools" should be selected (on which the correct paths are indicated):

    NetBeans: project properties> Build> Tool collection

Unable to start pty process

Related answer: It can create, but cannot run C code in netbeans (but it works on the command line)

So, right-click on the project, Properties> Run> Console Type> External Terminal (instead of, for example, "Internal Terminal"). Here is a screenshot:

NetBeans: project, Properties> Run> Console Type> External Terminal

+2
source

Here is your problem:

 gcc: Command not found 

Cygwin is not a compiler; it is a unix-like environment for Windows. Gcc is a compiler. You must install gcc with Cygwin before it works.

0
source

Source: https://habr.com/ru/post/1496061/


All Articles