Configuring Cygwin C/C++ compiler for Netbeans 6.5 (under Windows)
Posted by Roy Triesscheijn on Friday 20 March, 2009
Note: since the 1st of December 2009, this blog was moved to www.roy-t.nl, all content here should be considered archived, new content, updates, comments, etc… will no longer be released here. A fresh copy of this article exists at the new website, here you can post comments and ask questions which I will try to answer asap.
Sincerely,
Roy Triesscheijn
Today I tried setting up Netbeans as a C IDE, it has built in support for C, but unfortunately enough you have to manually configure a compiler so that you can actually debug / build your C/C++ programs.
Fortunately there is this helpful page at Netbeans.org to help you install Cygwin, a very popular UNIX/Windows C/C++ compiler. However, this helpful page isn’t as helpful as I’d hope at all! It will point you in the right direction to download Cygwin, and will tell you what packages to select for download, it will even tell you to set up your PATH environment variable for Cygwin, but it will assume Netbeans auto detects the correct settings, which it unfortunately doesn’t do. (Well at least at my pc, and I’ve seen a few threads with the same problems around).
So here is my attempt at a more complete overview on installing Cygwin for Netbeans 6.5.
Go to http://www.cygwin.com/setup.exe and download the small setup program. Run it (if your using Vista, set the compatibility options to XP SP2, and run it as administrator). Follow the pretty standard steps until you get to choose the installation packages. If you thought just pressing next would install the most common Cygwin apps, like the compiler (gcc.exe) and the make implementation, unfortunately Cygwin, is not just a C/C++ compiler, it even includes a java compiler, games, documentation, text editors etc. . Ok so just install everything, well that will install the compiler etc., but also 3GB of (for us) useless data. So don’t make the same mistake I did there. We are going to search for the few packages that we actually need. According to the Netbeans.org these are:
select gcc-core: C compiler, gcc-g++: C++ compiler, gdb: The GNU Debugger, and make: the GNU version of the ‘make’ utility.
Unfortunately these aren’t easy to find. For example there is no core package directly visible (we do have base and development though). It took me a while but I think I’ve nailed it down. Select the following packages by clicking the weird “refresh” icon next to them until it says install:
-The entire base package
-In the development package select:
–binutils
–gcc core
–gcc g++
–gcc g77
–gcc mingw core
–gcc mingw g++
–gcc mingw g77
–gdb
–make
–mingw runtime
(note I’m not sure about the mingw packages, this seems to be a seperate C compiler but it doesn’t seem to harm)
After that go to windows configuration screen->advanced->environment variables. And add “C:\Cygwin\Bin” to the PATH variables (or wherever you have located your Cygwin\bin folder, (make sure to separate it from the last one with a ‘;’).
Start Netbeans, navigate to tools->options->C/C++. Check to see if Cygwin is in the list on the left panel. Select it, and then fill in the options as following: (I assume that you’ve installed it in C:\Cygwin)
Base Director: C:\Cygwin\bin
C compiler C:\Cygwin\bin\gcc.exe
C++ Compiler: C:\Cygwin\bin\g++-3.exe*
Fortran Compiler: C:\Cygwin\bin\g77-3.exe*
Make Command: C:\Cygwin\bin\make.exe
Debugger: C:\Cygwin\bin\gdb.exe(* marks optional)
Now make a new C project. And add a new main file to it by right clicking the source directory and selecting New->Main C file. There is an odd chance that the include directives will be underlined with red. This is not a problem, as you will see the program will compile and run fine, but you can’t use intellisense this way so we are going to fix it. (First make sure your PATH variable was correctly set!).
Right click on your project and select properties. Go to build->C compiler (or C++ compiler if you are doing C++). Select the “…” button after Include Directories. And add the “C:\Cygwin\usr\include” directory to the include directories. Save your settings and reload your project. The red lines should’ve disappeared now, leaving you behind with a fully functional C/C++ IDE and compiler in Netbeans. *Yay*!
(I wish someone else would’ve written this before me, so that I wasn’t busy uninstalling a couple of gigabytes of C/C++ tools/compilers/utilities/fonts and text editors!)

George said
I followed the instructions on netbeans and had exactly the same issues. your instructions are way better. Maybe they should add a link to this page on the netbeans page. Good job and thanks for sharing your efforts with the rest of the world.
royalexander said
Hey George,
Great that it worked out for you this way! The instructions on the netbeans page are indeed very criptic.
Kelvin said
Subject: Cygwin new version faulty
Solution: Cygwin 1.5 thru setup_legagy.exe
OK, Im having been trying to install the c/c++ plugin for netbeans IDE 6.9 using the instruction from the netbeans support and from this website: http://royalexander.wordpress.com/2009/03/20/configuring-cygwin-cc-compiler-for-netbeans-65-under-windows/
so decided to use cygwin as the build engine. the build was fine but it crashes when I run it. So I dig and dig. I even open up its location in my c drive and run it manually. finally, I found this different error message:
“entry point cygwin_create_path could not be located in dynamic link library cygwin1.dll”
This narrows down the problem to cygwin after googling, I found that it might be a compatibility issue with the new cygwin update 1.7 So I install the 1.5 version instead and it worked!!! Here is how you can do it too: download the older version off the cygwin website:the setup_legacy.exe run the .exe make sure to change to a new root directory name (if you have 1.7 already) for the cygwin download as you will be prompted. create a location for download cache inside that directory once you chose a mirror you can search for these in the development: –binutils –gcc core –gcc g++ –gcc g77 –gcc mingw core –gcc mingw g++ –gcc mingw g77 –gdb –make –mingw runtime
hit next to install the cygwin package
set the environment variable (thru advanced system setting for vista). under system variable add C:\cygwin\bin; to the path variable
open up netbeans and open new project c/c++ app under tools chose options and click on the c/c++ to add host add host. Chose to path to the root location of cygwin and then bin make it default it will have a name like cygwin_1 or whatever ex: C:\cygwin_legacy\bin netbeans will detect all compilers etc OK the thing
Now right click on the project and hit property click on build to the right, change the tool collection to cygwin_1 (or whatever the name was)
write a hello world program (I did in c++)
debug and run the thing It should work! I hope this will help others like me in the future I spent 4-5 hours over several days trying to figure this bug out. It was hard because the error message was not helpful unless you run the .exe manually. Only then you will get the entry point message.
Here is the build message (successful but crashed when run):
“/usr/bin/make” -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf make[1]: Entering directory /cygdrive/c/Users/Kelvin/Documents/NetBeansProjects/CppDebug’ “/usr/bin/make” -f nbproject/Makefile-Debug.mk dist/Debug/Cygwin_1-Windows/cppdebug.exe make[2]: Entering directory/cygdrive/c/Users/Kelvin/Documents/NetBeansProjects/CppDebug’ mkdir -p build/Debug/Cygwin_1-Windows rm -f build/Debug/Cygwin_1-Windows/main.o.d g++-3.exe -c -g -MMD -MP -MF build/Debug/Cygwin_1-Windows/main.o.d -o build/Debug/Cygwin_1-Windows/main.o main.cpp mkdir -p dist/Debug/Cygwin_1-Windows g++-3.exe -o dist/Debug/Cygwin_1-Windows/cppdebug build/Debug/Cygwin_1-Windows/main.o
make[2]: Leaving directory /cygdrive/c/Users/Kelvin/Documents/NetBeansProjects/CppDebug’ make[1]: Leaving directory/cygdrive/c/Users/Kelvin/Documents/NetBeansProjects/CppDebug’
BUILD SUCCESSFUL (total time: 24s)
John Derrick said
thanks dude, I thought i done bad
Josh said
This works.
marcellus | wolfdart said
Tks, its worked!
TheRoot said
Hey, Great! it works! I solve that bit of the problem however, i couldn’t run my programs (can’t click run button or command) in netbeans. i have set the system variables the way you specify. Have you encountered this same problem ? I’m using a 32-bit Vista by the way. Cheers
royalexander said
Hey TheRoot, hmm that sounds like a strange problem. I haven’t encountered it yet. Are you sure you’ve restarted Netbeans (and your computer?) and that you have created a new clean C project in Netbeans? (or C++ if you where aiming for that one). Also make sure that in the options in Netbeans the compilers etc.. are listed under the C/C++ section.
John Greece said
Thanks mate, you’ve done some great work. It took me hours to find out what was wrong…
Really helpful guide!
razz said
Hi. Can anybody help me? When I try to Run/Build/Debug my application I get this error:
—
Running “C:\Programy\cygwin\bin\make.exe -f Makefile CONF=Release” in C:\Documents and Settings\Pavel\Plocha\c\app\Application_1
/usr/bin/make -f nbproject/Makefile-Release.mk SUBPROJECTS= .build-conf
make[1]: Entering directory `/cygdrive/c/Documents and Settings/Pavel/Plocha/c/app/Application_1′
/usr/bin/make -f nbproject/Makefile-Release.mk dist/Release/Cygwin-Windows/application_1.exe
make[2]: Entering directory `/cygdrive/c/Documents and Settings/Pavel/Plocha/c/app/Application_1′
mkdir -p build/Release/Cygwin-Windows
rm -f build/Release/Cygwin-Windows/test.o.d
gcc.exe -c -O2 -I/cygdrive/C/Programy/cygwin/usr/include -MMD -MP -MF build/Release/Cygwin-Windows/test.o.d -o build/Release/Cygwin-Windows/test.o test.c
mkdir -p dist/Release/Cygwin-Windows
gcc.exe -o dist/Release/Cygwin-Windows/application_1 build/Release/Cygwin-Windows/test.o
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld: cannot find -luser32
collect2: ld returned 1 exit status
make[2]: *** [dist/Release/Cygwin-Windows/application_1.exe] Error 1
make[2]: Leaving directory `/cygdrive/c/Documents and Settings/Pavel/Plocha/c/app/Application_1′
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory `/cygdrive/c/Documents and Settings/Pavel/Plocha/c/app/Application_1′
make: *** [.build-impl] Error 2
Build failed. Exit value 2.
—
I installed according to instructions…
royalexander said
Hi Razz, it seems there is something wrong with -luser32, try searching for that, unfortunately I have no idea what could cause this problem, does this also occur on a new clean C project?
majorcode said
yes i have an problem about this issue same error occured when im start to debug….
MakiS said
axa.. thanks , i just press to download all packages and netbeans find them alone… , ty
kisa14 said
hiss
thanks for the tutorial, it really worked for me, but I just have a problem, it build the programs and all of that but when I try to run them this message come
This application has failed to start because cygwin1.dll was not found
Re-installing the aplication may fix this problem
what could I do?? or I have to re-install all the components again?
just that and thanks!!
royalexander said
Hey Kisa14,
I’ve looked into my Cygwin\bin folder and indeed there is a file called cygwin1.dll located there, can you check if your bin folder has the same file or that it is really missing? You can try to reinstall the cygwin cg and cg++ compilers.
kisa14 said
Hi,
Well yes, I just found it there.
But I kind of solve the problem by other way, I just modified the path, because I haven’t put the ‘-3′ there, now I put it and the program is working xP
Any way thanks a lot for the tutorial!!! and for answering so soon ^^
byess
kisa14 said
By the way, the prove program just run and close, I can’t even see it xD (but well the other programs I have from my labs run correctly ^^U)
JOhn said
Ok where did you find packages ? you just google them??? thanks in advance
The entire base package
-In the development package select:
–binutils
–gcc core
–gcc g++
–gcc g77
–gcc mingw core
–gcc mingw g++
–gcc mingw g77
–gdb
–make
–mingw runtime
royalexander said
Hey John there are in the standard GNU installer
Quang said
Thanks a lot. It worked. ^^
UCSC said
hey guys its worked …thax a lot
udara said
i did exactly the same thing mentioned above,but there is no gcc.exe file in folde “bin”.Instead there is a shortcut called gcc.exe.lnk which links to “/etc/alternatives/gcc”.So i choosed gcc-3.exe for c compiler.But when i make a new c project it says ” cannot find include file “. but it works for c++.dont know y?
royalexander said
Hey Udara,
Unfortunately I don’t have an answer to your question, but maybe someone else visiting this website has. I would recommend figuring out if you can remove all the gcc apps and see if it works the second time, maybe you’ve forgot to select an option. (Alternatively you can try repairing the installation and checking if you missed something)
Anubhav said
Hi Udara,
You could use the following steps(Netbeans 6.5):
1. Tools->Options->C/C++->Code Assistance->C Compiler->Add.
2. Add this directory: C:\cygwin\lib\gcc\i686-pc-cygwin\3.4.4\include (Replace C:\cygwin\ with your cygwin home)
3. Done
I hope it helps.
Also I think the following packages are optional with gcc’s core compilers:
–gcc mingw core
–gcc mingw g++
–gcc mingw g77
–mingw runtime
Pradeek said
You can find these in the devel package instead of manually searching.
Cris said
Thank you so much for posting these instructions- I was stumped for 18 straight hours losing my mind trying to get this to work… your instruction here is a life saver- really thanks again
royalexander said
Hey Cris,
Glad to hear you got this working!
jOBr said
Excelent job man, I had this configuration but I formatted my computer, now I cannot add it to my netbeans, I have the same Udara’s problem.
i’ll aprecciate any help thk
Milos Grcic said
thnx mate! it works to me
Fata1Diabl0 said
This is so cool.
thanks for your help. i really appreciate your effort.
I’ve been looking for a solution for weeks. thanks to you i can have more fun programming. Thanks a lot dude and may god bless you!
mizbase said
Thanks buddy,
really helped, i think netbean should link your page,
the help page sucks, regarding the instruction they have given
thanks a lot
satish said
hey frds…somebody help me..i followed the same instructions..still i am getting this error..
———————————————————————————————
Running “C:\Program Files\MATLAB\R2007a\bin\win32\gmake.exe -f Makefile CONF=Debug” in C:\SATISH PERSONAL\Application_1
/cygdrive/c/Users/satish/AppData/Local/Temp/make38802.sh: line 2: syntax error: unexpected end of file
C:\Program Files\MATLAB\R2007a\bin\win32\gmake.exe: *** [.validate-impl] Error 2
Build failed. Exit value 2.
—————————————————————————————————
what could be the problem?
royalexander said
Hey Satish, it looks like the compiler and stuff got installed perfectly but that there is an error in your code. Also your not using the GNU compiler but a special compiler for Matlab so it seems so I’m sorry but I can’t really help you with this error.
joer86 said
hey could guyz help me? i’ve been encountering an output error with the C++ sample code “welome”. the project builds and debugs fine but when i run it it shows this in DOS…
“C:/Users/SATEL~1AppData/Loca/Temp/dlight736194469083965267termexec.env: line1: syntaxerror near unexpected token ‘(‘
C:/Users/SATEL~1AppData/Local/Temp/dlight736194469083965267termexec.env: line1: ‘PATH=/bin:/user/bin::cygdrive/C/Windows/system32:/cygdrive/C/Windows:/cygdrive/C/Windows/System32/Wbem:/cygdrive/C/PROGRA~2/COMMON~1/ULEAD~1/MPEG:/cygdrives/DivX\Share/:/cygdrive/C/Program\Files\(x86)/Quicktime/QTSystem/:/cygdrive/C/cygwin/bin: && export PATH’
Press [Enter] to close the terminal…”
the code is very simple w/c is just supposed to output Welcome and this a sample code from Netbeans itself. I followed instructions from Netbeans site and from urs exactly… looks like i should settle for turbo c++… tsk tsk.
Sue said
Thanks for the steps. But I can’t add the paths to windows configuration screen->advanced->environment variables. Every time I try from “My Computer/Properties”, configuration screen came up for 2 second and disappear. Is it a must to add the path?
royalexander said
Well you can try if it works, but you should really add the path, are you sure you are working on an account that has administrative priviliges?
Eugene Kovalev said
Thanks a ton, these really helped.
I’m just a beginner and I’m trying to learn a little bit of C before I go to college. I installed this program and followed all the instructions but when I try to run this “Hello, World” program:
#include
main()
{
printf (“Hello, World!”);
return 0;
}
I get the following messages and I have absolutely no clue what they mean, Please Help!
/usr/bin/make -f nbproject/Makefile-Debug.mk SUBPROJECTS= .build-conf
make[1]: Entering directory `/cygdrive/c/Users/Eugene Kovalev/Briefcase/My Programs/Learning C programming/Learning C’
/usr/bin/make -f nbproject/Makefile-Debug.mk dist/Debug/Cygwin-Windows/learning_c.exe
make[1]: *** [.build-conf] Aborted (core dumped)
make[1]: Leaving directory `/cygdrive/c/Users/Eugene Kovalev/Briefcase/My Programs/Learning C programming/Learning C’
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 6s)
royalexander said
Hey Eugene, unfortunately I’m still no C(++) expert. Your code does look correct, however I think something went wrong with your include statement, you don’t finish it so your entire program now looks like an include statement.
Try changing the first line to something like:
#include
(for more info on that notation see: http://msdn.microsoft.com/en-us/library/36k2cdd4(VS.71).aspx )
Hope this helps)
BigBwana said
I’m having problems, I downloaded and installed using the setup.exe (I used the defaults) from cygwin. It looks like I have everything (even the desk icon) except for the compilers.
In C:\cygwin, there is everything EXCEPT:
C compiler C:\Cygwin\bin\gcc.exe
C++ Compiler: C:\Cygwin\bin\g++-3.exe*
Fortran Compiler: C:\Cygwin\bin\g77-3.exe*
Make Command: C:\Cygwin\bin\make.exe
Debugger: C:\Cygwin\bin\gdb.exe
Maybe I downloaded from a screwy site, but it was on the list.
What can I do to finish my instillation?
BigBwana said
Ok, I think I figured it out – forgot to select the compilers in the dev package – Kinda thought they would be there by default.
royalexander said
Ah yeah it’s a bit strange indeed, but there are so many compilers in the GNU installer that it would be harsh to install them all by default
.
Kotushka said
Thunk you a lot.
” Base Director: C:\Cygwin\bin
C compiler C:\Cygwin\bin\gcc.exe
C++ Compiler: C:\Cygwin\bin\g++-3.exe*
Fortran Compiler: C:\Cygwin\bin\g77-3.exe*
Make Command: C:\Cygwin\bin\make.exe
Debugger: C:\Cygwin\bin\gdb.exe
”
this part was very useful for me. This is not said properly even by the net beans.
Chandan said
please give me brief information how to configure cygwin in netbeans 6.9 with versions and step by step
i am installed mingw netbeans automatically detected only gcc,g++,g77,as
it doesn’t finds make file,qmake,cmake,gdb please help me
KJB said
Once your C and C++ compilers are installed.
You should only add include libraries to the project that are different from the standard compiler libraries.
To add or check standard libraries that are to be included click on Tools->Options and then select C/C++ at the top of the window that appears.
Now select the Code Assistant tab.
The top panel has a C and a C++ tab.
Now start a cygwin command window
Start->All Programs->Cygwin->Cygwin Bash Shell
Type or copy this command for the c compiler
`gcc -print-prog-name=cc1` -v
where gcc is your C compiler.
This will give you a list of include libraries that the preprocessor is using. Make your otions window match this list.
Now the C++ compiler
`gcc -print-prog-name=cc1plus` -v
gcc is still the C compiler and not the C++ compiler.
This will give you a list of include libraries that the preprocessor is using. Make your otions window match this list. Make sure that the C++ tab is selected or you will be updating the C include list.
Your code assistant now matches your compiler.
Any additional libraries that you now want to use and are not part of the current project should be added to the project->preferences.
royalexander said
Thanks for this helpful tip mate!
QZip said
Hey, I tried the NetBeans instructions, but, since they were about as helpful as a knife in the back, I fubared something. When I went into the Environment Variables and changed my path, I DELETED the old path and REPLACED it with “C:\cygwin\bin” when, it seems from your instructions I was just supposed to add that (with a
to the END of whatever the hell was there. Now, I have no idea what was there and no way to tell the thing to default back to whatever it was before I screwed it up. If I go into NetBeans, it can’t detect Cygwin. Can you help? I’m running Windows XP Service Pack 3 (if it matters).
royalexander said
Hey QZip, that is a really serious problem since the path variable is not only the C(++) path variable but also the commandline, JAVA, .NET PATH variable (and probably much more) I can’t really give you some way to get it back, maybe you can do a system restore. You can’t copy the PATH variables from someone else because not everyone has installed their applications at the same locations. Your best bet to partially get everything working again if system restore fails is to find someone with XP Service Pack 3 and rougly the same software installed, copying their PATH variable to your pc and hoping you both installed most applications at their default locations.
(I know this all sucks, most modern installers modify the path variable for you, unfortunately Cygwin and especially the Cygwin installer is ‘way odd’.)
Good luck with restoring your computer, sorry I can’t help you I’m running Vista.
Ricky said
Thank you a lot, this was so helpful for me.
Greetings
Bruce said
Wow, thanks! That was extremely helpful.
Maru said
Hi, thank you SO much for this, I can’t tell you how many hours I spend trying to get this done!!!! I’m so used to JAVA that whenever some comes to me asking for help with C (I’m a TA on a fundamentals of programming class) I remember that I haven’t done this stuff for my netbeans…
Does this steps also work on nebeans 6.7?????
PS: sorry for my english… I’m from South America =)
royalexander said
Hey Maru,
No problem, and I think this will work for most versions of Netbeans
.
Arpit said
Hello:
I am in a fix. Please suggest me some help. I am building an application and using Cygwin development environment. All compilation is successful but every time at linking stage I get the error 53 !!
see this -
(LD) exe/DEBUG/DSP1_p0.dxe exe/DEBUG/DSP1_p1.dxe exe/DEBUG/DSP1_sm.dxe
“C:\Program Files/Analog Devices/VisualDSP 4.5/linker.exe” -jcs2l -si-revision
0.5 -T DSP1.ldf -Map ../../Integration/build/exe/DEBUG/DSP1.map.xml -od ../../In
tegration/build/exe/DEBUG -MDBUILD_TYPE_DEBUG
make[1]: *** [../../Integration/build/exe/DEBUG/DSP1_p0.dxe] Error 53
make[1]: Leaving directory `/cygdrive/c/Y050-buildBV/Integration/build’
make: *** [binaries-all] Error 2
Please let me know if you require some more info. But since past one week, I am stupidly wasting my time trying solving this issue but still not successful
royalexander said
Hey Arpit, I have no idea how to fix this issue, best ask it at a forum related to Cygwin C++ compiler. (Maybe the Cygwin website or mailing list?). I’ll leave your comment here so other people might suggest fixes.
Arpit said
Hello Royal:
I checked with Analog Devices guys today.. they say,
” ‘Error 53′ is being reported by cygwin itself. and reports “The network path was not found”. If the error was being reported by VisualDSP++ tools it would be in our standard error format. For a linker failure, the error message would have the form li####: “li” as a prefix meaning it came from the linker and the “####” being the error number that can be used to index help documentation.
Since the error comes from cygwin we are going to have a limited ability to determine the cause. We can only suggest that you check that the path reported in the error message from cygwin exists and you have proper permission to access it. ”
So they say its not a linker error basically but a Cygwin path error. Can you suggest me what they mean by network path of Cygwin?
royalexander said
Hey Arpit,
I wouldn’t know what they mean with network path, I mean all your files are on a local drive right? Can you check if “../../Integration/build/exe/DEBUG/DSP1_p0.dxe” is indeed 2 folders up from the working directory?
Arpit said
Hey Royal,
Yeah. you are right. It is indeed a local drive! so your explanation is perfect – there cannot be a problem with network path, but then what is causing Error 53? Analog Devices people say its not Visual DSP, its Cygwin causing the error..
tom said
Worked very nicely. Thank you very much Roy.
BA said
Thanks Roy… that was a real help. I’m way past the thrill of spending fruitless hours to make things work that should be intuitive. You are on the list of people to be reimbursed if I ever get to make money from my current C++ development .
royalexander said
Yeah, this could’ve been made so easy! Oh well. Glad you found it helpful, good luck with your C++ programs!
Nate said
Did my best to follow your instructions, still getting this error when I try to build:
/usr/bin/make -f nbproject/Makefile-Debug.mk SUBPROJECTS= .build-conf
make[1]: Entering directory `/cygdrive/c/Users/Nathan/Documents/NetBeansProjects/HelloWorldNative’
/usr/bin/make -f nbproject/Makefile-Debug.mk dist/Debug/Cygwin-Windows/libHelloWorldNative.dll
make[2]: Entering directory `/cygdrive/c/Users/Nathan/Documents/NetBeansProjects/HelloWorldNative’
mkdir -p build/Debug/Cygwin-Windows
make[2]: mkdir: Command not found
make[2]: *** [build/Debug/Cygwin-Windows/newmain.o] Error 127
make[2]: Leaving directory `/cygdrive/c/Users/Nathan/Documents/NetBeansProjects/HelloWorldNative’
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory `/cygdrive/c/Users/Nathan/Documents/NetBeansProjects/HelloWorldNative’
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 1s)
Assistance would be appreciated!
Billy said
Same thing happend to me =(
Arpit said
Hi Royal.
Finally got rid of that error. Had a tough time tracing that out. Yeah, as i said, you were correct that AD people were incorrect in telling Err 53 being a network path error.
Interestingly, the project was using a tool MapReader.exe of CadCorp that evaluates linker files. And my machine was not having .netframework installed that caused problem with its initiation and hence at linking stage Visual DSP was unable to commence -> that way, the poor guy Cygwin which was being used had no clue but to show me Error 53 coz of this!!
Thanks for your help. Am glad after eliminating this 53 from my m/c!!
Koen said
Quite a neat site you have here, Royal! Not sure what it’s all about though.
dan said
Thank you very much for your effort.
I’m from Romania.
A good day to you.
khosi said
I am from South Africa. Thank you very much. This article is the ish, each and every step of the configuration is well laid out.
Joey said
I have followed your unstruction completely but when I enter “C:\Cygwin\bin\gcc.exe” it enters as red and when i open up netbean it tells me
Could not successfully run the C:\Cygwin\bin\gcc.exe compilerto configure the built-in source file paser.
Please make sure C:\Cygwin\bin\gcc.exe is in your PATH and restart the ide
Its tells me that the compiler is missing or invalid…
Im only new at this so any help would be very much appricated
royalexander said
Hey Joey,
Did you make sure that the file was actually there? See if it is and if g++ is there as well. They might be named differently (Often g++-3.exe and gcc-3.exe).
Joey said
Hello sir
Ya the files are all in there but as type shortcut….Im using netbeans 6.7.1 on vista…
the c++ compiler is working Just not the c compiler(the one i need)
regards
Arjita said
This is awesome! I spent so much time trying to figure this out…until I found this post.
Really helpful and clear. Thanks
JKirk said
This site was useful, but I still seem to have problems.
I can’t seem to understand what you meant when you described adding the Path. How exactly does one get to the “Windows Configuration Screen” on Vista?
My compilers seem to have added correctly, but the code I’m trying to work on doesn’t include the appropriate libraries.
I’m new to NetBeans, so any help would be appreciated.
royalexander said
Just right click your ‘my computer’ in the start menu and select properties.
Vencat said
Hello there.
Thanks a lot for this useful tips.
I followed it to start a C++ application on Netbeans6.7.1 windows and every hello world, or Netbeans samples seem to work fine. But I have troubles when I start to use wstring.
When I #include and declare a std::wstring, g++ whispers me that wstring is not part of std…
My paths seem good… I have no clue.
Any idea ?
Thanks again.
larles said
It seems that wide strings are not supported by cygwin :/
larles said
It seems that wide strings are not supported by cygwin :/
http://www.cygwin.com/ml/cygwin/2009-01/msg00436.html
vencat said
I found a potential solution : stop using Cygwin and try MinGW.
Everything works now.
Thanks again.
kibre said
building is successful but it won’t run…. The system cannot find the path specifiedProcess is started in an external terminal …
RUN FAILED
this message appears… any idea ,
royalexander said
Kibre, I have no idea maybe someone else will find a solution.
The Weba said
Thanks so much!!! ^_^
royalexander said
No problem
Sonal said
Followed all instructions as above, but still stuck up with this error
Can you please help..
Error:
CLEAN SUCCESSFUL (total time: 200ms)
nbproject/Makefile-Debug.mk:79: .dep.inc: No such file or directory
make: /bin/sh: Command not found
make: *** [.depcheck-impl] Error 127
BUILD FAILED (exit value 2, total time: 187ms)
royalexander said
Hey Sonal, doesn’t look like a cygwin error to me. Maybe try searching for err127 and depcheck-impl
CodenameA said
You are GOD!!!
Your instructions just saved me hours of wasted time and you may also have saved my computer from ending up like this:
ThX!
royalexander said
Haha thanks!
ml said
hey thank you so much, i was about to crash my computer because of compiler problem, you saved my homework!
dwi said
I have installed cygwin successfully and set the path. But I dont see Netbeans in anywhere. Please help!
Roy Triesscheijn said
Netbeans is a seperate program (an IDE) that helps you create programs. You have to download and install Netbeans yourself, check http://netbeans.org/ .
Irfan said
Hey Bro
I tried to download cygwin but I couldn’t find mirrors. U gave a link does not working says forbidden.. something. if u have any alternatives Please share with me I will be very thankful.
Thanks
Irfan
Aravind said
Hi, I did everything you said, still there’s some problem. There’s no C:\Cygwin\bin\gdb.exe available. I mean, the gdb.exe is missing. and also, even after to setting the PATH variable to C:\cygwin\bin netbeans IDE says {unable to configure C compiler: C:\Cygwin\bin\gcc.exe, set PATH variable to C compiler: “C:\Cygwin\bin\gdb.exe” and restart IDE again.} I did but it says the same thing again. Then I changed C compiler to: “C:\Cygwin\bin\gcc-3.exe”, the problem got resolved. After all this, my project is unable to build. Its says “Build Failed”. Please help me.
Lord Skass said
Hi! Thank you so much!
I have already installed correctly NetBeans 6.8 and Cygwin!
I have a problem: when the compiler works there is this error
“Impossibile open the file: dorun.sh”
I’m Windows Vista user but the exstension “.sh” is used in Linux OS
(I’ve downloaded the Microsoft Version and I don’t know what must I do…)
(Sorry but I’m from Italy, I hope you’ll undestand)
Roy Triesscheijn said
Sorry Skass, I have no idea what that error means. I’ve never encountered. Any luck on Google? Maybe post your question again at http://roy-t.nl since this article was moved there too, maybe someone sees it and posts a sollution.
Frustratedd said
I have this problem too. Have been loooking for a day still no solution
Leopard said
I installed cygwin successfully but when i run my program in netbeans , i got the following error:
Running “F:\Program Files\Cygwin\cygwin-b20\H-i586-cygwin32\bin\make.exe -f Makefile CONF=Debug” in E:\j programs\Java Project\nbproject\CTester
! was unexpected at this time.
make.exe”: *** [.validate-impl] Error 1
Build failed. Exit value 2.
I will be thankful if you help me.
Roy Triesscheijn said
I dont know for sure, but how about this: http://forums.netbeans.org/post-53831.html
Also: please post any further questions at http://roy-t.nl I dont come here often. (And come one guys, how big do I have to make the “Blog moved to http://roy-t.nl” text?).
joey said
Hi!
I have done all of your advices and when I started to compile a programme I got an error
java.lang.IllegalArgumentException
Process is started in an external terminal …
RUN FAILED
before the programme will be finished
Roy Triesscheijn said
Joey, your building / compiling JAVA, this has nothing todo with C++, so I think your totally doing something else
.
John said
Hi!
First of all thanks a lot for your helpfull tutorial on installing c/c++ on netbeans.
I got a lot further with your description than with the one offered on netbeans. I still encounter a tiny problem though.
Whenever I try to run an app I get the following error statement:
which: no pkg-config in (/usr/bin:/cygdrive/c/WINDOWS/System32)
make: pkg-config: Command not found
make: *** [.build-pre] Error 127
I tried to find out what is the problem with pkg config but I was unable to figure it out. Also checked if my path variables were set correctly and everything was okay.
So maybe you could help with this problem.
thanks a lot
john
BUILD FAILED (exit value 2, total time: 172ms)
Roy Triesscheijn said
Hey John,
Unfortunately I have no clue how to fix that error, maybe someone else has a clue?
taz said
Thanks, that works perfect.
compiling C++ with NetBeans said
[...] as if it doesn't have the needed libraries.I tried following this guide, but it didn't sort it out: c/c++ compiler for NetBeans 6.5 (under Windows) Here's screenshots of my settings: ImageShack Album – 3 images Can anyone please help me get my [...]
Sashi said
Can someone help please???
I did everything but cannot compile C++ programs but I could compile C programs. This is what get compiling C++ programs
/usr/bin/make -f nbproject/Makefile-Debug.mk SUBPROJECTS= .build-conf
make[1]: Entering directory `/cygdrive/c/Users/sashi/Documents/NetBeansProjects/HelloQtWorld_1′
VPATH=. -o qttmp-Debug.mk nbproject/qt-Debug.pro
/bin/sh: -o: command not found
make[1]: *** [nbproject/qt-Debug.mk] Error 127
make[1]: Leaving directory `/cygdrive/c/Users/sashi/Documents/NetBeansProjects/HelloQtWorld_1′
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 967ms)
Roy Triesscheijn said
It looks like you are using the c compiler for C++. Be sure to check your compiler settings in Nebeans and that the C++ compiler is called g++.exe
Sashi said
Under options I do have C++ compiler as C:\cygwin\bin\g++.exe . I dont know what is wrong.
I have the path name (under environmental variable) as
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\CyberLink\Power2Go
I didn’t even add C:\cygwin\bin
Sashi said
Under options I do have C++ compiler as C:\cygwin\bin\g++.exe . I dont know what is wrong.
I have the path name (under environmental variable) as
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\CyberLink\Power2Go
I didn’t even add C:\cygwin\bin
rodanmuro said
Hey man thanks a lot. I had that problem but now you resolve it. Thanks again.
lalit samar said
Running “make.exe -f Makefile CONF=Debug clean” in C:\Documents and Settings\India\My Documents\NetBeansProjects\Nat
To use Symbian OS tools without specifying a device name, a default
device must be set using the devices -setdefault command.
Clean failed. Exit value 2.
how solve this error plz help me
Gilmar said
I need help on this erros while trying to execute a C++ file in netbeans using cygwin:
It seens like the POSIX points to cygwin/c/Arquivos de programas… and I guess it should point to c:\Arquivos de programas…
Any solution?
Gilmar said
I need help on this error while trying to execute a C++ file in netbeans using cygwin:
http://img695.imageshack.us/img695/7076/errokf.jpg
It seens like the POSIX points to cygwin/c/Arquivos de programas… and I guess it should point to C:\Arquivos de programas…
Any solution?
BigSurf said
Thanks a lot, now I can all my job do in same IDE!
fsdfsd said
u r the biggest fool on earth
Roy Triesscheijn said
I’d love your explanation why.
Whipfire said
Thanks very much, Roy! Your instructions worked like a champ.
Uli said
Excellent guide, worked fine =)
ik.w said
excellent!! tnks
Carl said
many thanks, exactly what I was looking for as Netbeans.org and Cygwin was unable to explain cygwin install
M said
Hey, thanks for great information, but I have a problem. I use NetBeans IDE 6.7.1 and on the options>c c++>build tools, I also have a “assembler” between fortran compiler and make command. it says assembler missing or invalid. any suggestion how to fix it?
Michael Corleone said
It worked with NetBeans 6.9 too!
I cannot express how grateful I am.
Best
Roy Triesscheijn said
Wow and the comments are still dripping in. I’m very grateful for all the comments, but you should really place them here: http://www.roy-t.nl all the updates are there
. (I cant think of a way to make that even more apparent
, title should say enough).
Michael said
Oops … maybe it’s because users just scroll down till they see something that looks like instructions
Maybe it’s because most of us are already stressed by the non-working instructions found on Netbeans. Impatiently looking for a solution people wont spent time reading lead-ins, hints etc. They just want to know what to do.
Chibu Jax said
This is great,not everyone can share their effort
KRISH said
I am using cygwin 2.697 & netbeans6.9
I came to now that this cygwin is a major release.
Above instructions are not working.
Please help me if you can find out anything…
waiting.
rahul said
i have this error Process is started in an external terminal …
RUN FAILED (exit value 127, total time: 456ms)
after running the welcome application in net beans
jagbir singh said
I have problem with make.exe in cygwin. i already add “C:\cygwin\bin\cyggcc_s-1.dll” in c compiler through tools/c/c++ in netbeans 6.8. but there is no make.exe in C:\cygwin\bin. please tell me how i can add make.exe or provide other command to add in make command in netbeans 6.8
advance thanks
jagbir singh
jagbir singh said
I have problem with make.exe in cygwin. i already add “C:\cygwin\bin\cyggcc_s-1.dll” in c compiler through tools/options/c/c++ in netbeans 6.8. but there is no make.exe in C:\cygwin\bin. please tell me how i can add make.exe or provide other command to add in make command in netbeans 6.8
advance thanks
jagbir singh
Abebe Tedila said
Hey, Thanks for ur support.
I am using windows 7 32 bit, when I tried to Install cygwin the packages are not displayed. What are u suggest me to do?
Thanks for ur help
Abebe Tedila
Dausayi said
Hey Roy Triesscheijn you saved my day 6month after your post
Oneil Drummond said
Kool!!…
Ram said
Thanks a ton for this post ! Really saved the day
Parag said
Thank you, worked like a charm. I got stuck and this page helped me out.
Matt said
Thank you.
These instructions were simple and straightforward. Worked like a charm!
Thuthuka said
Hi,
I followed your instructions but when I run the c application it shows the following error:
cygwin warning:
MS-DOS style path detected: /usr/bin/C:\Program
Preferred POSIX equivalent is: /usr/bin/C:/Program
CYGWIN environment variable option “nodosfilewarning” turns off this warning.
Consult the user’s guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
Can’t find C:\Program on PATH.
BUILD FAILED (exit value 29, total time: 156ms)
What may be wrong and how do I solve it?
Habtom said
Dear all, I was trying to use Cygwin for processing some netcdf file and my pc is 64 bite with windows 7 after I install cygwin and when I try to run some of *.exe that used for processing netcdf file i got the following message what should I have to do?
”the procedure entry point cygwin_create_path could not be located in the dynamic link library cygwin1.dll”
Thank you in advance.
Brian said
Thank you.
priya said
how to open .exe files in net beans??
Michael said
Thank you for sharing. I installed everything (at least I thought I did) the way it was described on Netbeans … after a while I found out there is something missing and a few Google moments later I found you tutorial here. You made me happy
Dylan said
Thanks!
Im using the latest Cygwin packages with Netbeans 6.9.1 and those includes are the one thing I couldn’t figure out.
You saved me countless hours.
Thanks again!
Dylan
Roy Triesscheijn said
Hey everyone,
Great to see that everyone is still finding this tutorial useful!! Many thanks!
However as noted the blog was moved to roy-t.nl so please continue there