Re: [pcre-dev] pcre static build on mingw32, no joy so far.

Góra strony
Delete this message
Autor: Nigel Metheringham
Data:  
Dla: David Mathog
CC: pcre-dev
Temat: Re: [pcre-dev] pcre static build on mingw32, no joy so far.

On 6 Jun 2011, at 23:10, David Mathog wrote:

>
>> Try to build my application (variations of the following work fine on
>> 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

> The preceding doesn't work, but this one does:
>
> gcc -Wall -std=c99 -pedantic -lm -O3 -DMAXINFILE=20 \
> -I/usr/local/include -static -DPCRE_STATIC \
> -o extract extract.c /usr/local/lib/libpcre.a
>
> I would have thought the two forms were equivalent, but apparently not.


I would suspect that this would also work:-

  gcc -Wall -std=c99 -pedantic -lm -O3  -DMAXINFILE=20 \
    -I/usr/local/include  -static -DPCRE_STATIC \
    -o extract  -L/usr/local/lib -lpcre extract.c 



--
[ Nigel Metheringham ------------------------------ nigel@??? ]
[                 Ellipsis Intangible Technologies                  ]