• 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: problems with static compilation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problems with static compilation


  • Subject: Re: problems with static compilation
  • From: Chris Espinosa <email@hidden>
  • Date: Mon, 30 Apr 2007 10:49:12 -0700


On Apr 30, 2007, at 7:58 AM, Hrishikesh Muruk wrote:

This is not an Xcode specific question. I apologize if this is the wrong list. I get an error when trying to compile a simple program (below) with the -static flag. 

Mumukshu:~/tmp hrishi$ cat test.cpp
#include<iostream>

int main() {
  std::cout<<"Hello world\n";
  return 0;
}
Mumukshu:~/tmp hrishi$
Mumukshu:~/tmp hrishi$ g++ -static test.cpp
/var/tmp//cctnBafc.s:201:FATAL:incompatible feature used: section type non_lazy_symbol_pointers (must specify "-dynamic" to be used)

man g++ says the following for the -static flag:
"...This option will not work on Mac OS X unless all libraries (including libgcc.a) have also been compiled with -static.  Since neither a static version of libSystem.dylib nor crt0.o are provided, this option is not useful to most people."

Is it possible to compile static binaries on Mac OS X? 


Libraries, yes.  Executables, no.  You can create your own archive of code used by multiple projects (a "static library") but there is no way to load or execute that code into Mac OS X, other than to link it into a dynamic library (an executable or framework).

Chris
 _______________________________________________
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: 
 >problems with static compilation (From: Hrishikesh Muruk <email@hidden>)

  • Prev by Date: Re: project's plist
  • Next by Date: Re: I am still having problems setting breakpoints in a Java project
  • Previous by thread: Re: problems with static compilation
  • Next by thread: project's plist
  • Index(es):
    • Date
    • Thread