Re: How to create a self contained GTK+ Application for Linux



On Wed, 2007-05-23 at 23:44 +0200, David NeÄas (Yeti) wrote:
The current [working] directory is what getwd() returns.
At least that's what everyone else seems to mean by the
current directory.

Well obviously getpwd is not good enough, then.  What would be needed is
the directory the .so file was loaded from, not the working directory.
That's what everyone is meaning here when they say "./blah" in the
context of the linker.  Of course they don't mean the current executable
working directory.


And yes it is a good idea.

And it is ridiculous.

You're being difficult for the sake of being difficult.  I know you
understand what I am meaning about relative paths to the current
directory, meaning the directory from which the library was loaded,
symlink or no.


It works very, very well for the win32 GTK libraries.

Finding self is normally based on GetModuleHandleW()
+ GetModuleFileNameW() on Win32.  I asked how you do this on
other systems.

That's my question too, and others'.  In fact, by talking about the "./"
stuff that you're so caught on, that's exactly what we are asking. My
point was merely, Windows is ahead of us in this area, how can we
accomplish the same thing in a clean way?


Moreover, Win32 has some habit of looking for libraries in
the executable's directory, and that's both weird and the
only reason why it works.

It's different, but not weird.  In fact, in the context of the rest of
Windows, it's very logical.

And I (and others) am saying, there has to be a better way on Linux and
Posix systems.  Hard-coded paths are clunky.  If GTK's .so files can
dynamically find their plugin components based on an environment
variable, that is ideal.  In fact, if someone could help the original
poster in this, that would be the solution to his problem (well, other
than ancient libc abi problems).  I think that various thread posters
have pretty much stated that this is the current, best way to go.  Are
there any docs on what env strings to set?





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