• 怎么样Eclipse IDE for C/C++ Developers正确编译GTK规划?(解决)


    <span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 25.99431800842285px;  background-color: rgb(240, 240, 240);"><strong>(</strong></span><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; background-color: rgb(240, 240, 240); line-height: 25.99184799194336px;"><strong>已解决,详见<a target=_blank target="_blank" href="http://blog.csdn.net/acmerhlj/article/details/39720183" style="color: rgb(0, 0, 0); text-decoration: none; font-family: 'Microsoft YaHei'; line-height: 30px;">Ubuntu 12.04下在Eclipse IDE for C/C++ Developers中执行C语言的GTK程序</a></strong></span><span style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 25.99431800842285px;  background-color: rgb(240, 240, 240);"><strong>)</strong></span>
    
    出现错误信息例如以下,请问大牛该怎样解决?<strong><span style="font-size:14px;">(<span style="color: rgb(51, 51, 51); font-family: Arial; line-height: 25.99184799194336px;">已解决,详见<a target=_blank href="http://blog.csdn.net/acmerhlj/article/details/39720183" style="color: rgb(0, 0, 0); text-decoration: none; font-family: 'Microsoft YaHei'; line-height: 30px;">Ubuntu 12.04下在Eclipse IDE for C/C++ Developers中执行C语言的GTK程序</a></span>)</span></strong>
    00:52:56 **** Incremental Build of configuration Debug for project Again ****
    make all 
    Building file: ../why.c
    Invoking: GCC C Compiler
    gcc "../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 status
    make: *** [why.o] Error 1
    
    
    已经安装Ubuntu(ubuntu-12.04-desktop-i386)、gtk 2.24.10、Eclipse IDE for C/C++ Developers(eclipse-cpp-luna-R-linux-gtk.tar);<span style="font-family: Arial, Helvetica, sans-serif;">在终端能够编译并显示用C写的gtk窗体,在Eclipse里能编译普通的C/C++程序。</span>已经按http://blog.csdn.net/sunny2038/article/details/7082164的方法配置过Eclipse;已经……<span style="font-family: Arial, Helvetica, sans-serif;">包括非常多的头文件是由于提示找不到各个头文件,也尝试设置PKG_CONFIG_PATH。</span>还是出错,搜到相似问题(http://bbs.chinaunix.net/thread-3775510-1-1.html。http://bbs.csdn.net/topics/380110411),但还是改不好,太菜了!Ubuntu环境变量的设置是硬伤!求教大牛:怎样才干在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;
    }

    
    
    
    
    
    
    
    
    
        
            

    版权声明:本文博主原创文章。博客,未经同意不得转载。

  • 相关阅读:
    Windows 7 x64环境下SDK Manager闪退的解决方法
    Android 开发环境下载地址 -- 百度网盘 adt-bundle android-studio sdk adt 下载
    【智能家居篇】wifi网络结构(下)
    mac 查看python路径
    制作NGUI动态字体
    Mac OS 10.10.3下Apache + mod_wsgi配置【一】
    归档日志
    Cocos2D-X2.2.3学习笔记12(瞬时动作)
    合并两个已经排好序的不等长的数组
    JSON-JSON字符串转换成JSON对象、JSON对象数组、java实体类以及保存到List列表中
  • 原文地址:https://www.cnblogs.com/yxwkf/p/4858211.html
Copyright © 2020-2023  润新知