Legacy code symbol collision with glib


I have a large in-house library that I need to work with (and I'd
like to use Gtk in my current project), and this library uses the
same "g_" prefix as Glib, which ends up causing some name
collisions between the two libraries. The library code is used
throughout a number of projects, so though I have the source, I
can't disturb the code base by changing the names in there--what is
my best option here?

I was considering making a wrapper library of sorts wherein I
would, in the wrapper's initialization routine, dlopen() my
legacy .so and extract the various symbols I need, assigning
them to global variables with a different prefix, which could
in turn be used by code that uses both the legacy library and

Does this sound reasonable, or would it be better to divide my
program into parts and play games with the dynamic loader's library
path (the machinations of which I do not understand terribly well

I appreciate any comments.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]