2017-10-14 98 views
0

我安裝了預編譯WxWidget庫,並試圖運行代碼塊的默認程序,但它提供了以下錯誤:使wxWidgets的工作在C++

爲WxWidget圖書館和MinGW
mingw32-g++.exe: error: bin\Release\new2.exe: No such file or directory 

路徑已經指定。 我的問題是;如何使CodeBlocks爲WxWidgets項目生成一個.exe文件?

我已經嘗試過在這個問題中列出的所有解決方案:"No such file or directory" error in CodeBlocks

完整的生成日誌:

-------------- Build: Release in new2 (compiler: GNU GCC Compiler)--------------- 

mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -Wno-unused- 
local-typedefs -Wall -O2 -ID:\WxWidgets\wxWidgets2.8\include -I\msw -c 
C:\Users\ShifaShah\Documents\new2\new2App.cpp -o obj\Release\new2App.o 
mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -Wno-unused- 
local-typedefs -Wall -O2 -ID:\WxWidgets\wxWidgets2.8\include -I\msw -c 
C:\Users\ShifaShah\Documents\new2\new2Main.cpp -o obj\Release\new2Main.o 
windres.exe -ID:\WxWidgets\wxWidgets2.8\include -I\msw -J rc -O coff -i 
C:\Users\SHIFAS~1\DOCUME~1\new2\resource.rc -o obj\Release\resource.res 
mingw32-g++.exe -L -o bin\Release\new2.exe obj\Release\new2App.o 
obj\Release\new2Main.o obj\Release\resource.res -s -mthreads -lwxmsw_core -lwxbase -lwxpng -lwxzlib -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 - 
ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lcomctl32 -lwsock32 -lodbc32 -mwindows 
mingw32-g++.exe: error: bin\Release\new2.exe: No such file or directory 
Process terminated with status 1 (0 minute(s), 3 second(s)) 
1 error(s), 0 warning(s) (0 minute(s), 3 second(s)) 
+0

先按下構建按鈕。 – VTT

+0

構建項目是導致上述錯誤的原因。 –

+0

然後請發佈完整的生成日誌。 – VTT

回答

3
-L -o bin\Release\new2.exe 

這裏的問題。 -L標誌需要參數,但不提供常用參數(用於搜索庫的目錄)。因此,下一個標誌-o被解釋爲-L的參數,並且bin\Release\new2.exe被解釋爲輸入文件的名稱,這當然不存在。

檢查您的編譯器標誌並確保沒有任何地方存在任何偏離-L,並且沒有將「附加庫目錄」指定爲空白字符串或類似字符。

+0

從編譯選項檢查編譯器標誌,對嗎?那裏沒有-L旗。 –

+0

@ 13.SS CodeBlocks從某處獲取此錯誤標誌。我提到了另一種可能性,鏈接器設置中的空白搜索目錄,將其檢出。一個未定義的環境變量會導致一個空目錄。 –

+0

以下鏈接庫在鏈接器設置中定義: wxmsw_core,wxbase,wxpng,wxzlib 沒有未定義的環境變量。 –