libc.a:undefined reference to '_environ' (in crt1.c and spawnp.c)
Example: symify.c in djgpp/src/debug/common
In order t make things work, I replaced one line in src\libc\crt0\crt1.c
extern char **_environ;
with
char **_environ;
Is that the right thing to do? Or is there a cleaner fix?
By the way, some more files in djgpp CVS tree still do not compile, even
with this modification: v2load.c in djgpp/src/debug/common, and
go32-v2.c in djgpp/src/stub give an error "undefined reference to
'environ'".
Regards,
Fabrizio
> libc.a:undefined reference to '_environ' (in crt1.c and spawnp.c)
> Example: symify.c in djgpp/src/debug/common
> In order t make things work, I replaced one line in src\libc\crt0\crt1.c
> extern char **_environ;
> with
> char **_environ;
> Is that the right thing to do? Or is there a cleaner fix?
No. If you want to use the whole CVS you should use everything from
cvs. In this case you need lib/djgpp.djl (I think). But you should
really get everything.
(It is possible to selectively pick stuff, but then you shouldn't be
surprised if there are problems; e. g. the one you have right now.)
Right,
MartinS
Yes.
Download latest update of gcc-3.4.3 (or gcc-3.3.5 if You are stick with
gcc-3.3.X) for DJGPP, which I uploaded in begin of March. The linker script
is modified to provide _environ.
Andris
PS. It's highly recommended not to mix object files generated by this update
(and perhaps later versions) with ones generated by any earlier releases.
So You must rebuild them after upgrade.