• 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: -m64 on Intel works with gcc but not Xcode
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: -m64 on Intel works with gcc but not Xcode


  • Subject: Re: -m64 on Intel works with gcc but not Xcode
  • From: Tommy Nordgren <email@hidden>
  • Date: Sun, 29 Apr 2007 15:50:40 +0200


On 29 apr 2007, at 12.42, Robert Purves wrote:


From the command line, gcc on my Intel Mac allows -m64 and produces working 64 bit executables:
$ cat test.c
#include <stdio.h>
int main( void )
{
printf( "Hello, World!\n" );
return 0;
}


$ gcc test.c -o test -m64 && ./test
Hello, World!
$ file test
test: Mach-O 64-bit executable x86_64

On attempting to build the same file as a Standard Tool in Xcode 2.4.1, compilation is OK but if -m64 is supplied as OTHER_CFLAGS, there's a link error:
/usr/bin/ld: Undefined symbols:
_main
/usr/lib/gcc/i686-apple-darwin8/4.0.1/../../../crt1.o reference to undefined _main


Xcode seems less capable than gcc itself. Is there a workaround?

Robert P.
	Your example (with gcc) compiles and link witha singel command.
In XCode, you need to pass the appropriate flag to the linker as well.

-------------------------------------
This sig is dedicated to the advancement of Nuclear Power
Tommy Nordgren
email@hidden



_______________________________________________
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: 
 >-m64 on Intel works with gcc but not Xcode (From: Robert Purves <email@hidden>)

  • Prev by Date: Re: Linking DefaultRuneLocale?
  • Next by Date: Re: -m64 on Intel works with gcc but not Xcode
  • Previous by thread: -m64 on Intel works with gcc but not Xcode
  • Next by thread: Re: -m64 on Intel works with gcc but not Xcode
  • Index(es):
    • Date
    • Thread