求救:如何在Eclipse IDE for C/C++ Developers中正確編譯GTK程式?,developersgtk

來源:互聯網
上載者:User

求救:如何在Eclipse IDE for C/C++ Developers中正確編譯GTK程式?,developersgtk

出現錯誤資訊如下,請問大牛該如何解決?00:52:56 **** Incremental Build of configuration Debug for project Again ****make all Building file: ../why.cInvoking: GCC C Compilergcc "../why.c" -I/usr/include/glib-2.0 -I/usr/include/atk-1.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/lib/i386-linux-gnu/gtk-2.0/include -I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/gtk-2.0 -O0 -g3 -Wall ‘pkg-config --cflags gtk+-2.0‘ -MMD -MP -MF"why.d" -MT"why.d" -o "why.o"/tmp/cciyb0Cn.o: In function ‘main’:/home/shw/workspace/Again/Debug/../why.c:5: undefined reference to ‘gtk_init’/home/shw/workspace/Again/Debug/../why.c:6: undefined reference to ‘gtk_window_new’/home/shw/workspace/Again/Debug/../why.c:7: undefined reference to ‘gtk_widget_show’/home/shw/workspace/Again/Debug/../why.c:8: undefined reference to ‘gtk_main’collect2: ld returned 1 exit statusmake: *** [why.o] Error 1已經安裝gtk 2.24.10、Eclipse IDE for C/C++ Developers;已經按<a target=_blank href="http://blog.csdn.net/sunny2038/article/details/7082164">http://blog.csdn.net/sunny2038/article/details/7082164</a> 配置過Eclipse;已經……還是出錯,搜到類似問題<a target=_blank href="http://bbs.chinaunix.net/thread-3775510-1-1.html">http://bbs.chinaunix.net/thread-3775510-1-1.html</a>,但還是改不好,太菜了!求教大牛:如何在Eclipse IDE for C/C++ Developers中正確編譯GTK程式? 測試代碼:#include <gtk/gtk.h>int main( int argc, char *argv[] ){        GtkWidget *window;        gtk_init (&argc, &argv);        window = gtk_window_new (GTK_WINDOW_TOPLEVEL);        gtk_widget_show (window);        gtk_main ();        return 0;}




Eclipse IDE for C/C++ Developers 編譯

編譯失敗了,應該還是環境沒配好或者庫沒找到,
LINUX下面挺複雜的,當初我也弄了很久。。。
哥編譯成功的,可是哥已經忘了怎麼弄了。。。
你直接在WIN下面好了,這個配很簡單的,環境變數裡面加幾句就可以了
 
用eclipse怎編譯gtk程式?

ubuntu?
 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.