Path: csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!news.swapon.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: Programming openssl Date: Mon, 03 Aug 2015 12:24:15 -0700 Organization: None to speak of Lines: 39 Message-ID: References: <55bce017.8665140@news.xs4all.nl> <55be93b8.1078968@news.xs4all.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="945944de09706c9b4e29b53c9d2efdc2"; logging-data="10364"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/5VDJ88+XvppPrNAaEQke8" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:gZGD6OsuMPqMM3Sb+qyl59jcYYo= sha1:SIH3S9KuPxy6EgrMH2bgDzJsQkQ= Xref: csiph.com comp.lang.c:66810 raltbos@xs4all.nl (Richard Bos) writes: > Keith Thompson wrote: >> raltbos@xs4all.nl (Richard Bos) writes: >> > doctor@doctor.nl2k.ab.ca (The Doctor) wrote: >> > >> >> getenv.o(.text+0x65): undefined reference to `environ' >> >> getenv.o(.text+0x72): undefined reference to `environ' >> > >> >> What do I need to fix this problem? >> > >> > Build this program using an implementation which defines "environ". IIRC >> > this is POSIX, but I may be wrong and it could be Ganuck; in any case, >> > your code should use , and I'm surprised that it doesn't >> > already. >> >> FYI, "Ganuck" is Richard's silly nickname for GNU. > > And I still don't know whether environ is GNUbile or POSIX, despite you > and all other GNUheads being perfectly capable of adding that > information. > > Embrace and extend, embrace and extend. environ is defined by POSIX. http://pubs.opengroup.org/onlinepubs/9699919799/functions/environ.html Looking back at the original article, I'm not sure why you think the OP's code needs to use . Environ is not declared in ; you need to declare it yourself as: extern char **environ; (I can't think of any good reason for that, but that's the way it is.) -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"