Bug 2329

Summary: Gtk.Application.Init() fails with EntryPointNotFoundException on the latest source from master
Product: [Mono] Gtk# Reporter: Sergey Litvinov <phoenixxua>
Component: gtk-sharpAssignee: Bugzilla <bugzilla>
Status: RESOLVED FIXED    
Severity: normal CC: knocte, mono-bugs+mono
Priority: ---    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: All   
Tags: Is this bug a regression?: ---
Last known good build:

Description Sergey Litvinov 2011-12-03 09:53:28 UTC
As I saw from gtk-sharp-list emails – source code from master should support gtk3. And I am trying to build and use it with gtk 3. But I’ve found a problem.
I use gtk 3.2 libraries under Ubuntu\Windows 7. For Windows 7 I’ve downloaded gtk3.2 from OpenSUSE build server and latest version of gtk-sharp from master branch.

I found one strange thing in https://github.com/mono/gtk-sharp/blob/master/glib/Thread.cs . For g_thread_get_initialized it uses external call to libgthread-2.0-0 library. But in that library there is no such method and when I try to call  Gtk.Application.Init() - it fails with EntryPointNotFoundException. It fails with the same error on both Windows and Ubuntu.  I investigated glib source and gtk-sharp/glib history and found that such method exist in libglib-2.0-0.

The library name in Thread.cs file was changed at Jan 7 2011 in this commit - https://github.com/mono/gtk-sharp/commit/ea7c52bbf9aabdd7f8103ea032afe43084f137b7#glib/Thread.cs 
I’ve locally updated library name in Thread.cs to libglib-2.0-0.dll, built it again, and tried to call Gtk.Application.Init(). And seems it was successful. 

The method g_thread_get_initialized introduced in glib 2.20 and it's still exists in 2.30 (http://developer.gnome.org/glib/2.30/glib-Threads.html#g-thread-get-initialized). 
However in glib 2.31 they marked it as deprecated thread API because of new simplified thread API:
http://mail.gnome.org/archives/gtk-devel-list/2011-October/msg00056.html
http://developer.gnome.org/glib/2.31/glib-Deprecated-Thread-APIs.html#g-thread-get-initialized
Comment 1 Sergey Litvinov 2011-12-03 10:19:39 UTC
I made a pull-request to gtk-sharp repo - https://github.com/mono/gtk-sharp/pull/28
Comment 2 Andres G. Aragoneses 2012-05-06 18:54:43 UTC
Hey Sergey, I fixed this in master as Mike Kestner recommended on the pull request (checking for the version in the configure script). Sorry if I stepped on your toes! but there was no activity since 5 months.

Thanks

(PS: can someone close the bug? I don't have permissions to do it)
Comment 3 Sergey Litvinov 2012-05-07 08:50:34 UTC
Many thanks to you :) It's very good, that you made this pull request for that issue, because I haven't enough experience to modify configure\makefile files.

I update an issue status to Resolved, because you fixed it :)