Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: environ symbol undefined?



On Fri, 25 Mar 2005 21:45:37 -0800
Matt Watson <email@hidden> wrote:

> >   _environ
> >   libtool: internal link edit command failed
> >
> > What doesn't libc export that symbol? What am I doing wrong?
> 
> Are you building a shared library? If so, that symbol gets filled in  
> at process startup time, so it is only defined in executables. You  
> need to do something like:
> 
> #include <crt_externs.h>
> #define environ (*_NSGetEnviron())

Yup. That fixes it. Maybe this should really be added to the .SYNOPSIS
of the environ(7) man page?

Thanks,
Mike

-- 
IRC - where men are men, women are men, and the boys are FBI agents.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-dev/email@hidden

This email sent to email@hidden

References: 
 >environ symbol undefined? (From: Michael B Allen <email@hidden>)
 >Re: environ symbol undefined? (From: Matt Watson <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.