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: Jerry Krinock <email@hidden>
- Date: Tue, 02 May 2006 13:09:16 -0700
- Thread-topic: Linker can't find symbol _environ in Framework
on 06/05/02 12:18, Eric Albert at email@hidden wrote:
> The right solution to this problem is actually to
> #include <crt_externs.h>
> in the file in your library or framework code which references environ.
>
> Hope this helps,
> Eric
I just tried that Eric, but still get the same linker error. I know you
spelled that filename correctly, because I get "file not found" if I
mis-spell it.
Here's a demo you can do in 5 minutes:
1. Use Xcode 2.2.1.
2. New Cocoa framework.
3. To the project, add the following 7 files from
developer.apple.com/samplecode/MoreIsBetter
MoreCFQ.c version 1.7
MoreCFQ.h version 1.9
MoreSecurity.c version 1.11
MoreSecurity.h version 1.8
MoreUNIX.c version 1.7
MoreUNIX.h version 1.3
MoreSetup.h version 1.14
4. To the project, from /System/Library add Security.framework
5. Build.
Expected Result: Success.
Actual Result: Linker error: Undefined symbols: _environ
Variation:
Repeat the experiment but instead of Cocoa in step 2 use Carbon.
Same results.
Variation:
Add to top of MoreSecurity.c:
#include <crt_externs.h>
Same results.
I wish a nice simple fix like that would work!
_______________________________________________
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