Determining the path to a Library
trev.saunders at gmail.com
Mon Jan 10 14:38:38 UTC 2011
On Mon, Jan 10, 2011 at 06:42:25AM -0600, John J. Boyer wrote:
> Is there a reliable way for a library to determine the path from which
> it wa loaded. I want to use this as a base for referencing the data
> files that the library uses. Will this work on Mac OSX also?
the only thing that comes to mind is looking around in /proc/self for
something useful. I believe the standard solution to this problem is
that you use a #define for the path of the data in the source, and then
use the build system to arrange for that define to be defined as
whatever the path should actually be. So what whould generally happen
is that autotools stuff would arrange for DATA_PATH to be defined as
what ever the make variable DATADIR is. This should be fairly portable,
but I don't have an OSX box so....
> John J. Boyer; President, Chief Software Developer
> Abilitiessoft, Inc.
> Madison, Wisconsin USA
> Developing software for people with disabilities
> Blinux-list mailing list
> Blinux-list at redhat.com
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 836 bytes
Desc: Digital signature
More information about the Blinux-list