The error message is as follows. How can Daniel solve it?
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
GTK 2.24.10 and eclipse IDE for C / C + + developers have been installed; eclipse has been configured by pressing < a target = ﹐ blank href = "http://blog.csdn.net/sunny2038/article/details/7082164" > http://blog.csdn.net/sunny2038/article/details/7082164 < / a >
It's still an error. I found a similar problem < a target = _blankhref = "http://bbs.chinaunix.net/thread-3775510-1-1. HTML" > http://bbs.chinaunix.net/thread-3775510-1-1. HTML < / a >, but it's not good to change. It's too delicious! How to compile GTK program correctly in eclipse IDE for C / C + + developers?
Test code:
#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;
}
SOS: How do I compile the GTK program correctly in Eclipse IDE for C + + developers?