RE: Linker can't find symbol _environ in Framework
RE: Linker can't find symbol _environ in Framework
- Subject: RE: Linker can't find symbol _environ in Framework
- From: "David Litwin" <email@hidden>
- Date: Tue, 2 May 2006 11:05:23 -0700
- Thread-topic: Linker can't find symbol _environ in Framework
Sorry, that wasn't correct. The app calls an API in the shared lib to
set a pointer after it is loaded, then the lib can use that pointer when
it wishes.
The awkward part was the lib couldn't just call back to the app when it
needed it (it is not linked against the app, the app is linked against
it) and instead it had to be provided ahead of time.
David Litwin
BigFix, Inc.
-----Original Message-----
From: David Litwin
Subject: RE: Linker can't find symbol _environ in Framework
I just had the same problem two days ago with a shared library that
wanted to inspect the environment.
The _environ symbol is found in crt0.o, which isn't linked for anything
but my final executable. I had to rig a system by which the app would
provide it to the shared lib (awkward for me, as the shared lib is
loaded with dlopen and so had to dlsym back to the app for the routine
to provide it).
David Litwin
BigFix, Inc.
-----Original Message-----
From: Jerry Krinock
Subject: Linker can't find symbol _environ in Framework
Hi,
I have created a Cocoa framework project using files factored out of a
working Cocoa application. The files I have factored out includes
Apple's
famous "MoreAuthSample" code, which includes Apple's famous MoreCFQ.c,
MoreUNIX.c and MoreSecurity.c.
MoreSecurity.c declares:
extern char **environ ;
which would seem to be the cause of this linker error:
Undefined symbols:
_environ
>From searching developer.apple.com I see that "environ" is apparently
some
variable at the Mach-O level.
I have added the frameworks "Carbon.framework" and "Security.framework"
to
this framework project.
How/can this be made to link? I've fixed all the compiler errors. This
one
linker error is my one remaining show-stopper.
Thank you,
Jerry Krinock
_______________________________________________
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