GDB赢得';t在NetBeans 7.1.1(0xc0000135)上运行 问题:我有一个C++ QT项目,它在我运行“run”时运行,当我手动执行输出可执行文件时运行,但不会在NETBeS中用GDB运行。在NetBeans中单击“调试主项目”后,我收到消息“启动期间程序退出,代码为0xc0000135”

GDB赢得';t在NetBeans 7.1.1(0xc0000135)上运行 问题:我有一个C++ QT项目,它在我运行“run”时运行,当我手动执行输出可执行文件时运行,但不会在NETBeS中用GDB运行。在NetBeans中单击“调试主项目”后,我收到消息“启动期间程序退出,代码为0xc0000135”,qt,netbeans,gdb,Qt,Netbeans,Gdb,我有调试器日志: =thread-group-added,id="i1" ~"GNU gdb (GDB) 7.4\n" ~"Copyright (C) 2012 Free Software Foundation, Inc.\n" ~"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change an

我有调试器日志:

=thread-group-added,id="i1"
~"GNU gdb (GDB) 7.4\n"
~"Copyright (C) 2012 Free Software Foundation, Inc.\n"
~"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.  Type \"show copying\"\nand \"show warranty\" for details.\n"
~"This GDB was configured as \"i686-pc-mingw32\".\nFor bug reporting instructions, please see:\n"
~"<http://www.gnu.org/software/gdb/bugs/>.\n"
&"C:\\\\Users\\\\Rafael Andreatta/.gdbinit: No such file or directory.\n"
(gdb) 
2-list-features
3-gdb-set print repeat 0
4-gdb-set backtrace limit 1024
5-gdb-set print elements 0
6-file-symbol-file "B:/Dropbox/Projects/rafaame/FileSync/dist/Debug/MinGW-Windows/FileSync"
7-file-exec-and-symbols  "B:\\Dropbox\\Projects\\rafaame\\FileSync\\dist\\Debug\\MinGW-Windows\\FileSync"
2^done,features=["frozen-varobjs","pending-breakpoints","thread-info","data-read-memory-bytes","breakpoint-notifications","ada-task-info"]
(gdb) 
3^done
(gdb) 
4^done
(gdb) 
5^done
(gdb) 
6^done
(gdb) 
7^done
(gdb) 
8-file-list-exec-source-file
9cd B:\Dropbox\Projects\rafaame\FileSync
10-exec-arguments 
11set environment Path=B:\Synced\Applications\Development\Cygwin\bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;B:\Synced\Applications\Development\Cygwin\bin;B:\Synced\Applications\Development\SDKs\jdk1.7.0_03\bin;B:\Synced\Applications\Development\SDKs\QtSDK\Desktop\Qt\4.8.0\mingw\bin;B:\Synced\Applications\Development\Clients\PrivateShell;
12-break-insert -f "B:/Dropbox/Projects/rafaame/FileSync/DebugHandler.cpp:29"
8^done,line="21",file="../mingw/main.c",macro-info="0"
(gdb) 
13-break-insert -t _start
&"cd B:\\Dropbox\\Projects\\rafaame\\FileSync\n"
~"Working directory B:\\Dropbox\\Projects\\rafaame\\FileSync.\n"
9^done
(gdb) 
10^done
(gdb) 
&"set environment Path=B:\\Synced\\Applications\\Development\\Cygwin\\bin;C:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;B:\\Synced\\Applications\\Development\\Cygwin\\bin;B:\\Synced\\Applications\\Development\\SDKs\\jdk1.7.0_03\\bin;B:\\Synced\\Applications\\Development\\SDKs\\QtSDK\\Desktop\\Qt\\4.8.0\\mingw\\bin;B:\\Synced\\Applications\\Development\\Clients\\PrivateShell;\n"
11^done
(gdb) 
12^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x00403fcb",func="DebugHandler::messageOutputLog(QtMsgType, char const*)",file="DebugHandler.cpp",fullname="B:\\Dropbox\\Projects\\rafaame\\FileSync\\DebugHandler.cpp",line="29",times="0",original-location="B:/Dropbox/Projects/rafaame/FileSync/DebugHandler.cpp:29"}
(gdb) 
13^error,msg="Function \"_start\" not defined."
(gdb) 
14-break-insert -t main
14^done,bkpt={number="2",type="breakpoint",disp="del",enabled="y",addr="0x00404ab4",func="main",file="../mingw/main.c",line="30",times="0",original-location="main"}
(gdb) 
15-exec-run
&"warning: Warning: Failed to open TTY /dev/pty0, error 0x3.\n"
=thread-group-started,id="i1",pid="3928"
=thread-created,id="1",group-id="i1"
~"[New Thread 3928.0x27d8]\n"
15^running
*running,thread-id="all"
(gdb) 
=thread-exited,id="1",group-id="i1"
=thread-group-exited,id="i1"
15^error,msg="During startup program exited with code 0xc0000135."
(gdb) 
是否有人有相同的问题并已修复


谢谢大家的帮助

我在一个<>强<>强时间>中没有接触过C++,但我今天遇到了类似的问题。原来有些库没有链接到可执行文件。我通过添加

-static-libgcc -static-libstdc++
到编译器选项(Makefile中的CXXFLAGS)

-static-libgcc -static-libstdc++