You are not logged in.
Pages: 1
I've decided to take a look at GTK2, but when I tried compiling the example program, I get this error:
In function `main':
/home/punkrockguy318/gtk/main.cpp:7: undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
My program is copied right from the site, because I got the same error when I wrote it myself. Here is what I used to compile
g++ `pkg-config --cflags --libs gtk+-2.0` hello.cpp
What's the deal?
and just for fun, here's the program...
#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;
}
If I have the gift of prophecy and can fathom all mysteries and all knowledge, and if I have a faith that can move mountains, but have not love, I am nothing. 1 Corinthians 13:2
Offline
GTK is written in C, so I guess you need to have something like:
extern "C" {
#include <gtk/gtk.h>
}
Of course you can also just write your program in C instead of C++, or use the C++ GTK wrapper.
Offline
Pages: 1