Netbeans 6.8 C++ IDE: program crashes while debugging in cygwin on windows
Whenever I try to debug my project in Netbeans 6.8 C++ IDE with cygwin on windows, it give开发者_Python百科s me the message window "Application crashed".(Netbeans IDE does not crash but only my program)There is no problem while running only, but while debugging, it crashes. Please help
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)
精彩评论