Re: __FILE__ is absolute, howto get relative?
Re: __FILE__ is absolute, howto get relative?
- Subject: Re: __FILE__ is absolute, howto get relative?
- From: Simon Strandgaard <email@hidden>
- Date: Wed, 9 Nov 2005 11:43:20 +0100
Thanks.. cd'ing to the dir helps.
prompt> cat test.cpp
#include <cstdio>
int main(char **argv, int argc) {
printf(__FILE__);
return 0;
}
prompt> gcc test.cpp
prompt> ./a.out
test.cpp
btw: howto tell xcode to use relative paths when invoking gcc?
--
Simon Strandgaard
On 11/9/05, Markus Hitter <email@hidden> wrote:
>
> Am 08.11.2005 um 23:53 schrieb Simon Strandgaard:
>
> > Any __FILE__ alternative that yields a path relative to the project?
> >
> > cout << "file: " << __FILE__ << endl;
> > file: /Users/simonstrandgaard/code/wc/repo/aeditor/experimental.mm
>
> I might be wrong on that, but it should be a matter of how you invoke
> the compilation.
>
> cd /Users/simonstrandgaard/code/wc/repo/aeditor/ && gcc experimantal.mm
>
> should give you what you want.
>
>
> Markus
>
> - - - - - - - - - - - - - - - - - - -
> Dipl. Ing. Markus Hitter
> http://www.jump-ing.de/
>
>
>
>
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden