2012-05-16 98 views
1

問題:我有一個C++ Qt項目,它在我點擊「運行」時運行,當我手動執行輸出可執行文件時運行,但不會運行NetBeans中的GDB。在NetBeans中單擊「調試主項目」後,我收到消息「啓動程序退出代碼爲0xc0000135」。GDB無法在NetBeans 7.1.1上運行(0xc0000135)

我有調試日誌:

=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) 

在Windows PATH環境變量是

C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;%SystemRoot%\system32; 
%SystemRoot%; 
%SystemRoot%\System32\Wbem; 
%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\; 
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; 
B:\Synced\Applications\Development\MinGW\bin 

有沒有人有同樣的問題和固定的嗎?

謝謝大家的幫助

回答

2

我沒碰過C++在時間,但今天我類似的問題。事實證明,一些庫不與可執行文件鏈接。我通過添加

-static-libgcc -static-libstdc++ 

到編譯器選項(在生成文件CXXFLAGS)

固定它