×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Regular Contributor
    Join Date
    May 2007
    Posts
    463

    glib gmodule - misfeature

    Consider this a potential bug report I guess. While I haven't tried it, I don't believe for a single second glib's gmodule actually works. The way the Nokia port is done, it's using the dlopen method of module loading. As you know, Symbian OS links by ordinal, so when glib tries to do something like this:

    if (g_module_symbol (module, "g_module_check_init", (gpointer) &check_init))

    There's no way that's going to work, because Symbian DLLs just don't have any symbolics in them for that kind of thing.

    As I say, I haven't tried it, but I reckon it's a total misfeature. The gmodule config ought to be changed to use the "NONE" configuration and not waste time by actually trying to load modules.
    Get Resolvr - The Zeroconf framework for Symbian OS free today. Make your IP networking applications fun and easy to use. http://www.novelinteractions.com/resolvr/
    Proud to be the only autorickshaw owner in Cambridge - http://blog.novelinteractions.com/images/tuktuk.jpg

  2. #2
    (Retired) Nokia Developer Admin.
    Join Date
    Jan 2006
    Location
    Michigan
    Posts
    4,664

    Re: glib gmodule - misfeature

    Thanks,
    I'll pass this on to our support staff to get their comments.

    Ron

  3. #3
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Posts
    115

    Re: glib gmodule - misfeature

    Dear cdavies-nokia,

    You are correct about native Symbian DLLs using ordinals to link.
    For OpenC there are new target types introduced, and should be used in mmp file. For DLLs, please use STDDLL. Symbol lookup via names is enabled for STDDLLs, while it is not so with native DLLs.
    I've gotten this information from our "Open C Introduction for Experienced S60 developers" webinars. There are other tips in the webinar too, so I encourage you to take a look.

    Thanks for your feedback

    Cheers!

  4. #4
    Nokia Developer Expert
    Join Date
    Nov 2003
    Posts
    43

    Re: glib gmodule - misfeature

    In the Open C SDK plug-in, it is a known limitation and it is actually documented in the Open C SDK documentation:

    "The g_module_symbol API must pass the ordinal number of the function as string and not the symbol name."

    Instead of using g_module_symbol (module, "g_module_check_init", (gpointer) &check_init)), you should use g_module_symbol (module, "3", (gpointer) &check_init)) (assuming that 3 is the ordinal number of g_module_check_init function in the def file. OK, using "3" directly is really ugly from coding point of view, it would be better to use some variable for that.

    The Open C SDK plug-in won't work with new target types like STDEXE and STDDLL (enabling symbolic function lookup by name). They will for the first time be introduced in S60 3rd Ed FP 2.

    The same limitation applies to the dlsym in libdl.

  5. #5
    Registered User
    Join Date
    Nov 2004
    Posts
    12

    Re: glib gmodule - misfeature

    Hi,
    I am trying to compile galago (http://www.galago-project.org/news/index.php), which uses glib and probably has the same problem. I am getting the errors while linking e.g. "undefined symbol 'g_thread_use_default_impl' referenced from line....".

    The problem is that I didnt find these symbols being used directly from galago (so that I can replace them with ordinal numbers). Can someone help me how to find these symbols in my project and replace them with ordinals, as I am quite new to open c and I know little about macros.

    Thanks,
    Vikki

  6. #6
    Registered User
    Join Date
    Aug 2004
    Posts
    4

    Re: glib gmodule - misfeature

    include the header glib_global.h. This file has the defination of the g_thread_use_default_impl and all other glib global variables.

    Ensure that the header is the last include among all the headers as this header has some macro definations which can cause issues at times.

  7. #7
    Registered User
    Join Date
    Nov 2004
    Posts
    12

    Thumbs up Re: glib gmodule - misfeature

    Thanks, It works!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×