[pcre-dev] [Bug 981] New: pcrecpp usage as static lib and MS…

Top Page

Reply to this message
Author: Vincent
To: pcre-dev
Subject: [pcre-dev] [Bug 981] New: pcrecpp usage as static lib and MSVC 2008
------- You are receiving this mail because: -------
You are on the CC list for the bug.

           Summary: pcrecpp usage as static lib and MSVC 2008
           Product: PCRE
           Version: 7.9
          Platform: x86-64
        OS/Version: Windows
            Status: NEW
          Severity: bug
          Priority: low
         Component: Code
        AssignedTo: ph10@???
        ReportedBy: vincent.bourdier@???
                CC: pcre-dev@???

Hi all,

Including pcrecpp.h in my projet, I get compil errors like :

1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport)
public: __thiscall pcrecpp::RE::RE(class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> > const &)"
referenced in function "public: static bool __cdecl RegEx::Match(class
std::basic_string<char,struct std::char_traits<char>,class std::allocator<char>
>,class std::basic_string<char,struct std::char_traits<char>,class

std::allocator<char> >,bool)"

There are two way to fix them :

* First one is to use a define before including the file
#define PCRE_STATIC 1
#include <pcrecpp.h>

* Second one is to use /clr option in the projet configuration.

I would like to know why the #define is necessary, because I compile PCRE as
static lib using Cmake.
I did not saw anything about that in the documentation.

Whatever, thanks for this good library :-)


Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email