Bug 2329 - Gtk.Application.Init() fails with EntryPointNotFoundException on the latest source from master
Summary: Gtk.Application.Init() fails with EntryPointNotFoundException on the latest s...
Alias: None
Product: Gtk#
Classification: Mono
Component: gtk-sharp ()
Version: unspecified
Hardware: PC All
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2011-12-03 09:53 UTC by Sergey Litvinov
Modified: 2012-05-07 08:50 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

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:
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.


(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 :)