Re: [pcre-dev] linker-errors using mingw

Top Page
Delete this message
Author: Sheri
Date:  
To: pcre-dev
Subject: Re: [pcre-dev] linker-errors using mingw
Robert Waniek wrote:
> Hello,
> I currently try to compile a project with mingw using pcre but I get the following error messages:
>
> lib\libzimpl-2.08.mingw32_nt-5.1.x86.gnu.dbg.a(iread.o): In function `i_read':
> C:/msys/1.0/zimpl/src/iread.c:690: undefined reference to `_imp__regcomp'
> C:/msys/1.0/zimpl/src/iread.c:696: undefined reference to `_imp__regerror'
> C:/msys/1.0/zimpl/src/iread.c:745: undefined reference to `_imp__regexec'
> C:/msys/1.0/zimpl/src/iread.c:807: undefined reference to `_imp__regfree'
> collect2: ld returned 1 exit status
> make: *** [bin/zimpl-2.08.mingw32_nt-5.1.x86.gnu.dbg] Error 1
>
> the lines referred to are:
>
>       int err = regcomp(&regex, match, REG_EXTENDED | REG_NOSUB);
> ...
>          regerror(err, &regex, errmsg, sizeof(errmsg));
> ...
>          if (match != NULL && regexec(&regex, s, 0, NULL, 0))
> ...
>       regfree(&regex);

>
> The project compiles with the pcre-7.0-mingw-version from the gnuwin32-homepage, but I need a static version of the library which I couldn't find anywhere.
> If I use any precompiled libraries they always need the dlls of pcre, but I need a single .exe-file into which everything is linked.
>
> I tried the pcre-version 7.6, 7.7, 7.8 and 7.8-RC1 with the same result (using "./configure --enable-static --disable-shared --prefix=/mingw/ ; make ; make install").
> MinGW is the current stable version intregrated into MSYS as recommended on the MinGW-Homepage.
>
> I hope anyone can help me.
> Thanks in advance
> Robert Waniek
> ____________________________________________________________________
>


Try linking your project to the pcreposix as well as the pcre library.
Prior to version 7.1, the pcre library included pcreposix when built
using configure/make under Msys/mingw (at least wrt shared dlls). I
recommend configuring pcre using cmake (See the non-unix text file for
info).

Regards,
Sheri