Re: Determining the path to a Library

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

 



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

Trev

> 
> Thanks,
> John
> 
> -- 
> John J. Boyer; President, Chief Software Developer
> Abilitiessoft, Inc.
> http://www.abilitiessoft.com
> Madison, Wisconsin USA
> Developing software for people with disabilities
> 
> _______________________________________________
> Blinux-list mailing list
> Blinux-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/blinux-list

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Blinux-list mailing list
Blinux-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/blinux-list

[Index of Archives]     [Linux Speakup]     [Fedora]     [Linux Kernel]     [Yosemite News]     [Big List of Linux Books]