undefined reference to environ

Lowell Gilbert freebsd-questions-local at be-well.ilk.org
Thu Apr 19 15:09:00 UTC 2007


"Desai, Rajesh" <rajesh.desai at windriver.com> writes:

> Hi,
>
> when i link my application witj -lc (libc). i get the following errors
>
>
> /usr/lib/libc.a(getenv.o): In function `getenv':
> getenv.o(.text+0x19): undefined reference to `environ'
> getenv.o(.text+0x29): undefined reference to `environ'
> getenv.o(.text+0x63): undefined reference to `environ'
> /usr/lib/libc.a(getenv.o): In function `__findenv':
> getenv.o(.text+0xd5): undefined reference to `environ'
> getenv.o(.text+0xe2): undefined reference to `environ'
> /usr/lib/libc.a(getenv.o)(.text+0x113): more undefined references to `environ' follow
> /usr/lib/libc.a(getprogname.o): In function `_getprogname':
> getprogname.o(.text+0x4): undefined reference to `__progname'
>
> can any body help me what can be wrong..and where i cam dinf thease symbols.

Those should be in the standard library also.
Can you come up with a simple test case that demonstrates the problem?
I can't reproduce anything like it on -STABLE.


More information about the freebsd-questions mailing list