Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: static linking if needed

9 views
Skip to first unread message

Nikos Chantziaras

unread,
Oct 5, 2012, 9:22:55 AM10/5/12
to help-gp...@gnu.org
On 09/06/12 20:29, Philipp Kraus wrote:
>[...]
> I have try to use the --static and --as-needed option in a little example:
>
> g++ --static --as-needed -O2 -pipe -Wall -o programm programm.o
> and get the error
> ld: library not found for -lcrt0.o

I assume you only have this problem on OS X? Try adding this option to
your compile and link flags:

-mmacosx-version-min=10.5

Substitute "10.5" with whatever minimum OS X version your program
depends on. Note: add it to both the compile *and* link flags.


0 new messages