Re: environ symbol undefined?
Re: environ symbol undefined?
- Subject: Re: environ symbol undefined?
- From: Matt Watson <email@hidden>
- Date: Fri, 25 Mar 2005 21:45:37 -0800
On Mar 25, 2005, at 9:01 PM, Michael B Allen wrote:
I reference the symbol environ(7) but the linker is choking on it:
ld: for architecture ppc
ld: Undefined symbols:
___eprintf
_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())
matt.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden