Re: Segfault trying to embed Mozilla using gtkmozembed
"santiago538" <[email protected]> Mon, 24 Oct 2005 23:56:57 GMT
| Newsgroups | gmane.comp.mozilla.devel.gtk |
|---|---|
| Organization | Another Netscape Collabra Server User |
| Message-ID | <dxe7f.5519$tl5.2285@trnddc02> |
This is only a guess, but your code (as is GTK) is in C, yet you compile it as C++ code. (function calls in C++ have their names mangled in order to encode their parameters.) Have you tried renaming your source to moztest.c and compiling it with something like: gcc \ `gtk-config --libs --cflags` `glib-config --libs --cflags` \ `pkg-config mozilla-gtkmozembed --libs --cflags` \ moztest.c -o moztest && ./moztest "Ondaware" <[email protected]> wrote in message news:[email protected]... > Hi all > > I've been trying to embedd mozilla. This is the test file I created. > Problem is, when I try to run it, it segfaults on the line where it > creates the > new browser (browser = gtk_moz_embed_new();). > > Any help would be appreciated. > > Thanks in advance. > > ----- > This is how I compile it: > > g++ \ > `gtk-config --libs --cflags` `glib-config --libs --cflags` \ > `pkg-config mozilla-gtkmozembed --libs --cflags` \ > moztest.cpp -o moztest && ./moztest > > --- this is the moztest.cpp file: > > #include <gtk/gtk.h> > #include "gtkmozembed.h" > #include "mozilla-config.h" > #include <stdio.h> > > int main(int argc, char * argv[]) > { > GtkWidget * window; > GtkWidget * browser; > > gtk_init(&argc, &argv); > > window = gtk_window_new(GTK_WINDOW_TOPLEVEL); > > printf("Setting up component path.\n"); > fflush(stdout); > > gtk_moz_embed_set_comp_path("/usr/lib/mozilla"); > > printf("Setting up profile.\n"); > fflush(stdout); > > gtk_moz_embed_set_profile_path("/safe/users/joao/.mozilla", "mozilla"); > > printf("Getting browser.\n"); > fflush(stdout); > > // browser = gtk_moz_embed_new(); > browser = gtk_moz_embed_new(); > > printf("Checking browser.\n"); > fflush(stdout); > > if(!browser) > { > printf("Browser is null.\n"); > fflush(stdout); > } > > gtk_container_add(GTK_CONTAINER(window), browser); > > gtk_moz_embed_load_url(GTK_MOZ_EMBED(browser), > "http://www.ondaware.com/"); > > printf("Here.\n"); > fflush(stdout); > > gtk_widget_show(window); > > gtk_main(); > > return 0; > }