Re: How to obtain library name at compile/preprocessor time?
- From: "Charles Mills" <cmills@xxxxxxxxxxxxx>
- Date: 30 Sep 2005 12:47:27 -0700
Hi,
babuyama wrote:
> Hi,
> Is there a way to obtain library name at compile/preprocessor time?
>
> Assuming that the compilation unit, myfile.c is part of mylib.a, from
> myfile.c code at compile/preprocessor time, I would like to know that
> the library name is "mylib". I could not find an equivalent of
> __FUNCTION__, __FILE__ defines for getting the library name. Is there
> another way?
> Thanks,
> Babu
As mentioned there is no way to do this with in the C standard. But
chances are your compiler supports command line arguments like
'-DLIBRARY_NAME=mylib.a' or something similar. If your using make
files it should be possible (or easy for that matter) to automate this
using make rules. Perhaps check a unix or make related newsgroup.
Good luck,
Charlie
.
- References:
- How to obtain library name at compile/preprocessor time?
- From: babuyama
- How to obtain library name at compile/preprocessor time?
- Prev by Date: Re: How to obtain library name at compile/preprocessor time?
- Next by Date: Re: How to obtain library name at compile/preprocessor time?
- Previous by thread: Re: How to obtain library name at compile/preprocessor time?
- Next by thread: Re: How to obtain library name at compile/preprocessor time?
- Index(es):