简体   繁体   English

Netbeans 6.8 C ++ IDE:在Windows上的cygwin中调试时,程序崩溃

[英]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 gives 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. 每当我尝试在Windows上使用cygwin在Netbeans 6.8 C ++ IDE中调试我的项目时,都会给我消息窗口“应用程序崩溃”。(Netbeans IDE不会崩溃,而只会崩溃我的程序)仅运行时,调试时没有问题,它崩溃了。 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/ 好的,我一直在尝试使用来自netbeans支持和以下网站的说明为netbeans IDE 6.9安装c / c ++插件: http : //royalexander.wordpress.com/2009/03/20/configuring-cygwin-cc Windows之下的-netbeans-65编译器/

so decided to use cygwin as the build engine. 因此决定使用cygwin作为构建引擎。 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. 我什至在c驱动器中打开它的位置并手动运行它。 finally, I found this different error message: 最后,我发现了以下不同的错误消息:

"entry point cygwin_create_path could not be located in dynamic link library cygwin1.dll" “在动态链接库cygwin1.dll中找不到入口点cygwin_create_path”

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!!! 谷歌搜索后,将问题范围缩小到cygwin,我发现这可能是与新cygwin更新1.7的兼容性问题,因此我安装了1.5版本,并且可以正常工作!!! 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. 您也可以这样做:从cygwin网站上下载旧版本:setup_legacy.exe运行.exe,请确保将cygwin下载更改为新的根目录名称(如果已经有1.7),您将被提示。 create a location for download cache inside that directory once you chose a mirror you can search for these in the development: 选择镜像后,在该目录中创建一个用于下载缓存的位置,即可在开发中搜索以下内容:

  • –binutils –binutils
  • –gcc core –gcc核心
  • –gcc g++ –gcc g ++
  • –gcc g77 –gcc g77
  • –gcc mingw core –gcc mingw核心
  • –gcc mingw g++ –gcc mingw g ++
  • –gcc mingw g77 –gcc mingw g77
  • –gdb –gdb
  • –make -使
  • –mingw runtime –mingw运行时

hit next to install the cygwin package 点击下一步以安装cygwin软件包

set the environment variable (thru advanced system setting for vista). 设置环境变量(通过vista的高级系统设置)。 under system variable add C:\\cygwin\\bin; 在系统变量下添加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. 打开netbeans并在工具选择的选项下打开新项目c / c ++应用程序,然后单击c / c ++添加主机添加主机。 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 选择路径到cygwin的根目录,然后将bin设置为默认值,它将具有cygwin_1之类的名称或其他任何名称:C:\\ cygwin_legacy \\ bin netbeans将检测所有编译器,等等。

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) 现在,右键单击该项目,然后单击属性,然后单击右侧的build,将工具集合更改为cygwin_1(或其他名称)

write a hello world program (I did in c++) 编写一个hello world程序(我在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. 我希望这将对以后像我一样的其他人有所帮助,我在几天内花了4-5个小时来尝试找出此错误。 It was hard because the error message was not helpful unless you run the .exe manually. 这很难,因为除非您手动运行.exe,否则错误消息无济于事。 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)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM