2016-05-23 96 views
0

我想在Eclipse上使用gtkmm編譯一個簡單的helloworld程序,並通過mingw32編譯與mingw32。gtkmm彙編錯誤

我跟着這些說明,「安裝」的gtkmm: https://wiki.gnome.org/Projects/gtkmm/MSWindows

我也讀了很多關於該主題的線程,但不明白爲什麼我不能編譯這個簡單程序:

#include <gtkmm.h> 

int main(int argc, char** argv) 
{ 
     auto app = Gtk::Application::create(argc, argv); 

     Gtk::Window window; 
     window.set_default_size(600,400); 

     return app->run(window); 
} 

通過蝕IDE我使用的

project=>properties=>C/C++build=>settings=>pkg-config

和我啓用的gtkmm-3.0。 然後我編譯,我得到的錯誤:

Info: Configuration "Debug" uses tool-chain "MinGW GCC" that is unsupported on this system, attempting to build anyway. 
Info: Internal Builder is used for build 
g++ -I/mingw32/include/gtkmm-3.0 -I/mingw32/lib/gtkmm-3.0/include -I/mingw32/include/atkmm-1.6 -I/mingw32/include/gdkmm-3.0 -I/mingw32/lib/gdkmm-3.0/include -I/mingw32/include/giomm-2.4 -I/mingw32/lib/giomm-2.4/include -I/mingw32/include/pangomm-1.4 -I/mingw32/lib/pangomm-1.4/include -I/mingw32/include/glibmm-2.4 -I/mingw32/lib/glibmm-2.4/include -I/mingw32/include/gtk-3.0 -I/mingw32/include/cairo -I/mingw32/include -I/mingw32/include/pango-1.0 -I/mingw32/include/atk-1.0 -I/mingw32/include/cairomm-1.0 -I/mingw32/lib/cairomm-1.0/include -I/mingw32/include/pixman-1 -I/mingw32/include/freetype2 -I/mingw32/include/libpng16 -I/mingw32/include/harfbuzz -I/mingw32/include/glib-2.0 -I/mingw32/lib/glib-2.0/include -I/mingw32/include/sigc++-2.0 -I/mingw32/lib/sigc++-2.0/include -I/mingw32/include/gdk-pixbuf-2.0 -I/mingw32/includ -O0 -g3 -Wall -c -fmessage-length=0 -std=c++11 -o main.o "..\\main.cpp" 
..\main.cpp:1:19: fatal error: gtkmm.h: No such file or directory 
compilation terminated. 

奇怪的是,我可以在編譯日誌,它包括需要對這一計劃的一切看到的。

我也試圖在

project=>properties=>C/C++build=>settings=>tool settings=> gcc c++ compiler and mingw linker

pkg-config gtkmm-3.0 --cflags --libs的結果,但我得到確切同樣的錯誤。

它使2天,我正在閱讀和嘗試我發現無處不在,但coudn't得到的結果相同的命題。 所以,請有人試圖幫助我找到一種方法來獲得這個簡單的例子工作。

謝謝很多 (PS:對不起,我的錯誤)

回答

0

我有同樣的問題,我解決它通過手動添加所有的這條道路,包括(項目Prorepties> C/C++編譯>設置> GCC C++編譯器>包含>包括路徑(-I)):

"C:\msys64\mingw32\include\gtkmm-3.0" 
"C:\msys64\mingw32\lib\gtkmm-3.0\include" 
"C:\msys64\mingw32\include\glibmm-2.4" 
"C:\msys64\mingw32\lib\glibmm-2.4\include" 
"C:\msys64\mingw32\include\glib-2.0" 
"C:\msys64\mingw32\lib\glib-2.0\include" 
"C:\msys64\mingw32\include\sigc++-2.0" 
"C:\msys64\mingw32\lib\sigc++-2.0\include" 
"C:\msys64\mingw32\include\giomm-2.4" 
"C:\msys64\mingw32\lib\giomm-2.4\include" 
"C:\msys64\mingw32\include\gdkmm-3.0" 
"C:\msys64\mingw32\lib\gdkmm-3.0\include" 
"C:\msys64\mingw32\include\pangomm-1.4" 
"C:\msys64\mingw32\include\gtk-3.0" 
"C:\msys64\mingw32\include\pango-1.0" 
"C:\msys64\mingw32\lib\pangomm-1.4\include" 
"C:\msys64\mingw32\include\cairo" 
"C:\msys64\mingw32\include\gdk-pixbuf-2.0" 
"C:\msys64\mingw32\include\cairomm-1.0" 
"C:\msys64\mingw32\include\freetype2" 
"C:\msys64\mingw32\include\atkmm-1.6" 
"C:\msys64\mingw32\include\atk-1.0" 
"C:\msys64\mingw32\include\gtkmm-3.0" 
"C:\msys64\mingw32\include\glibmm-2.4" 

(您768,16替換 「C:\ msys64 \ mingw32的」 與您的mingw32路徑)

另外補充-std=c++11標誌(項目Prorepties>ç/C++ Build> Settings> GCC C++編譯器>其它>其它標誌)和

glibmm-2.4 
gtkmm-3.0 

至(項目Prorepties> C/C++編譯>設置> MinGW的C++鏈接>庫(-1))