Auteur: David Mathog Date: À: Nigel Metheringham, David Mathog, pcre-dev Sujet: Re: [pcre-dev] pcre static build on mingw32, no joy so far.
Nigel Metheringham wrote:
> On 6 Jun 2011, at 23:10, David Mathog wrote:
> >> linux and solaris, albeit dynamic linking in both of those cases):
> >> $ gcc -Wall -std=c99 -pedantic -lm -O3 -DMAXINFILE=20 \
> >> -lpcre -I/usr/local/include -L/usr/local/lib \
> >> -static -DPCRE_STATIC -o extract extract.c
>
> -l and -L are positional qualifiers.
>
> If you are trying to use a library in a particular directory, then
> the -Ldirectory must go before the -llibrary - and normally both of the
> link flags would go towards the end of the command although I suspect
> that part is just convention
Except that doesn't work either:
gcc -Wall -std=c99 -pedantic -lm -O3 -DMAXINFILE=20 -DPCRE_STATIC
-I/usr/local/include -L/usr/local/lib -lpcre -static -o extra
ct extract.c
C:\DOCUME~1\david\LOCALS~1\Temp\ccHv3ooN.o:extract.c:(.text+0x8b77):
undefined reference to `pcre_compile'
etc.