From: Earnie B. <ear...@ya...> - 2003-07-18 13:23:45
|
Make sure that the package isn't defining or declaring it's own versions of sys_errlist. Include stdlib.h instead. Earnie. MARSHALL Keith wrote: > Hi Guys, > Using "mingw-3.0.0-rc3" on Win2000, I just tried to build "groff-1.18.1" from the GNU source > tarball. After some tinkering with the source code, I managed to get all the objects compiled, up > to the point where "make" attempts to build the "groff.exe" executable. At this point, "make" gives > up with the messages ... > > make[2]: Entering directory `/home/rgbl0264/groff-1.18.1/src/roff/groff' > g++ -g -O2 -o groff.exe groff.o pipeline.o > /home/rgbl0264/groff-1.18.1/src/libs/libgroff/libgroff.a -lm > Info: resolving __sys_errlist by linking to __imp___sys_errlist (auto-import) > fu000001.o(.idata$3+0xc): undefined reference to `libmsvcrt_a_iname' > nmth000000.o(.idata$4+0x0): undefined reference to `_nm___sys_errlist' > make[2]: *** [groff.exe] Error 1 > make[2]: Leaving directory `/home/rgbl0264/groff-1.18.1/src/roff/groff' > > I tried searching on Google for any advice which might relate to this -- could find only two > requests, on a MySQL mailing list, for help from others with a similar problem, but no answers. Can > anyone please explain what I need to do, to get around this error? > > For information, the patches I applied to "groff-1.18.1" to get this far were ... > > Had to work around the broken prototype for "mkdir" in MinGW's "io.h" ... > > ok, I followed a previous "mingw-users" discussion thread on this point, and patched the > "groff.1.18.1" source accordingly ... > > diff -Naur org/tmpname.cc new/tmpname.cc > --- org/tmpname.cc Wed Jul 16 08:58:32 2003 > +++ new/tmpname.cc Thu Jul 17 13:24:11 2003 > @@ -102,7 +102,14 @@ > v /= 62; > XXXXXX[5] = letters[v % 62]; > > +#ifdef _WIN32 > +// modified 17-Jul-2003 by Keith Marshall <kei...@to...> ... > +// Microsoft (TM) API, used by MinGW, doesn't support "mode" argument to "mkdir" ... > + int fd = dir ? mkdir(tmpl) > +#else > +// but POSIX standard code requires it ... > int fd = dir ? mkdir(tmpl, S_IRUSR | S_IWUSR | S_IXUSR) > +#endif > : open(tmpl, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR); > > if (fd >= 0) > > > GNU headers -- on my Linux box, at least -- define "sys_nerr" in "stdio.h"; MinGW has it in > "stdlib.h" ... > > Groff's "strerror.c" failed to compile because it needs this definition but doesn't #include > <stdlib.h>. Again, I fixed this by patching the "strerror.c" source ... > > diff -Naur org/strerror.c new/strerror.c > --- org/strerror.c Wed Jul 16 12:54:12 2003 > +++ new/strerror.c Thu Jul 17 13:24:11 2003 > @@ -22,6 +22,11 @@ > #endif > > #include <stdio.h> > +#ifdef __MINGW32__ > +/* added 17-Jul-2003 by Keith Marshall <kei...@to...> ... > + * so we can find declaration of "sys_nerr" in MinGW */ > +#include <stdlib.h> > +#endif > > #define INT_DIGITS 19 /* enough for 64 bit integer */ > > > (This is possibly a bug in the "groff-1.18.1" source itself; its "configure" script claims to > have found "sys_nerr" in *either* "stdio.h" *or* "errno.h", when it is actually in *neither*, > and the "strerror.c" source *requires* it to be in "stdio.h", but provides no mechanism for > locating it elsewhere -- this probably should have a more robust fix than just the above patch, > including appropriate changes to "configure.in"). > > The "getopt.h" header distributed with MinGW is not consistent with the GNU header of the same > name; "groff-1.18.1" includes a copy of the GNU header in its local "src/include" directory, and > *both* the GNU and MinGW versions get parsed by "gcc". This causes the compiler to throw an > exception, due to redefinition of "struct option", *and* inconsistent "extern" declarations for > the "getopt" function prototype itself; as a result, "make" gives up when attempting to compile > "htmlhint.cc". > > I worked around this one by hiding the "groff-1.18.1" version of "getopt.h" from the compiler, > (renamed it as "getopt.h.hidden"); however, would it not be better if the MinGW header > implementation included appropriate checks to prevent redefinitions, using the same #defined name > ("_GETOPT_H") as is used in the GNU header? Or, perhaps "configure.in" for "groff-1.18.1" should > check for the existence of headers in the standard compiler supplied locations, and disable use > of its own local copies, when the compiler supplies them (for all GNU headers for which the > distribution provides local copies)? > > Trust this will prove useful. I should be most grateful for any advice on solving the linking > problem described above. > > Regards, > Keith Marshall > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: VM Ware > With VMware you can run multiple operating systems on a single machine. > WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the > same time. Free trial click here: http://www.vmware.com/wl/offer/345/0 > _______________________________________________ > MinGW-users mailing list > Min...@li... > > You may change your MinGW Account Options or unsubscribe at: > https://lists.sourceforge.net/lists/listinfo/mingw-users > |