GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Sat Aug 23, 2014 7:30 am

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: [SOLVED] convert project from GTK3 to GTK2
PostPosted: Sun Mar 18, 2012 7:55 am 
Offline
Familiar Face

Joined: Thu Dec 15, 2011 6:23 pm
Posts: 36
Location: Hrvatska
you may ask why not from GTK2 to GTK3 ? here is the story: I was playing with that awesome CSS style provider in GTK3 and made some nice looking forms. unfortunately, my client insist on 3D presentation, I had allready made in another project using GTK2 and gtkglext, so I have to step back. that's the story.
now I wanna use those nice forms from GTK3 project and include in GTK2 project. it looks like easy job: I had removed GTK3 includes and libs and replace it with GTK2. In my code there is only one change: replace GtkGrid widget with GtkTable, and converted project compile and build without errors. but when started, it terminated immidietly with error:
Quote:
Gtk-ERROR **: GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported


here is my question: how can I find intruder ?
I don't understand why is there any GTK3 symbols at all ?

I check libs with pkg-config:
Quote:
pkg-config --libs gtk+-3.0
-pthread -lgtk-3 -lgdk-3 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo-gobject -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0

and also
Quote:
pkg-config --libs gtk+-2.0
-pthread -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0

It turns out: remove cairo-object, gtk-3 and gdk-3 and replace last two with gtk-x11-2.0 and gdk-x11-2.0

Same thing with Includes ( cflags ):
Quote:
pkg-config --cflags gtk+-3.0
-DGSEAL_ENABLE -pthread -I/usr/include/gtk-3.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12

and also
Quote:
pkg-config --cflags gtk+-2.0
-pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12


debug did not help at all - program break at very first line:
Code:
int main (int argc, char *argv[])
{
  gtk_init(&argc, &argv);         // -- terminated here !


I can copy - paste my code in old GTK2 project, just curious, what happens here ?


Last edited by kepica on Sun Mar 18, 2012 9:49 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: convert project from GTK3 to GTK2
PostPosted: Sun Mar 18, 2012 9:05 am 
Offline
Never Seen the Sunlight

Joined: Mon Apr 28, 2008 5:52 am
Posts: 745
Location: UK
Hi,

Have you check that you are linking with other libraries that depend on GTK+ v3?

You may be asking to link with GTK+ v2 but if another library depends on GTK+ v3 your application will be linking with both versions of GTK+. This situation is not supported.

_________________
E.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group