• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: __FILE__ is absolute, howto get relative?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >__FILE__ is absolute, howto get relative? (From: Simon Strandgaard <email@hidden>)
 >Re: __FILE__ is absolute, howto get relative? (From: Markus Hitter <email@hidden>)

  • Prev by Date: XCode Applescript: what does Target: Build Phases options mean
  • Next by Date: (off?) Interface builder - exploding a tab view into two separate tab views
  • Previous by thread: Re: __FILE__ is absolute, howto get relative?
  • Next by thread: Re: __FILE__ is absolute, howto get relative?
  • Index(es):
    • Date
    • Thread