From: Bob R. <bob...@co...> - 2008-02-21 19:00:01
|
On Thu, Feb 21, 2008 at 01:29:44PM -0500, Earnie Boyd wrote: > > Quoting Bob Rossi <bob...@co...>: > > >> > >> $ make -s > >> Making all in . > >> libmain.c:1: warning: -fPIC ignored for target (all code is position > >> independent) > >> libyywrap.c:1: warning: -fPIC ignored for target (all code is > >> position independent) > >> filter.c: In function 'filter_apply_chain': > >> filter.c:179: warning: passing argument 2 of 'execvp' from > >> incompatible pointer type > >> main.o:main.c:(.text+0x6d): undefined reference to `WIFEXITED' > >> main.o:main.c:(.text+0x7c): undefined reference to `WEXITSTATUS' > >> main.o:main.c:(.text+0x98): undefined reference to `wait' > >> tables.o:tables.c:(.text+0x9c1): undefined reference to `htonl' > >> tables.o:tables.c:(.text+0xa35): undefined reference to `htons' > >> filter.o:filter.c:(.text+0x215): undefined reference to `pipe' > >> filter.o:filter.c:(.text+0x239): undefined reference to `fork' > >> filter.o:filter.c:(.text+0x894): undefined reference to `wait' > >> collect2: ld returned 1 exit status > >> make[2]: *** [flex.exe] Error 1 > >> make[1]: *** [all-recursive] Error 1 > >> make: *** [all] Error 2 > >> > >> I'm not sure exactly how to fix this to be honest. Is it the intention > >> of flex to be portable? > >> > > Looks like the include of winsock2.h is missing. OK, I included 'windows.h', and then added -lws2_32 and got down to this: $ gcc -I/usr/include -o flex.exe ccl.o dfa.o ecs.o scanflags.o gen.o main.o misc.o nfa.o parse.o scan.o skel.o sym.o tblcmp.o yylex.o options.o scanopt.o buf.o tables.o tables_shared.o filter.o regex.o -lm -L/usr/lib -lregex -lws2_3 2 main.o:main.c:(.text+0x6d): undefined reference to `WIFEXITED' main.o:main.c:(.text+0x7c): undefined reference to `WEXITSTATUS' main.o:main.c:(.text+0x98): undefined reference to `wait' filter.o:filter.c:(.text+0x215): undefined reference to `pipe' filter.o:filter.c:(.text+0x239): undefined reference to `fork' filter.o:filter.c:(.text+0x894): undefined reference to `wait' collect2: ld returned 1 exit status Which is getting nice. I already realize that the remaining functions are not going to be available with mingw. The point here is, I'm trying to provide a patch back to the flex folks, so that flex builds out-of-the-box on mingw. Hmmm, perhaps I should look at the src flex package on sf, to find out what they did to get rid of the rest of these. Any other suggestions? Thanks, Bob Rossi |