Re: [pcre-dev] setting up pcrecpp on win32

Top Page
Delete this message
Author: Alex.Krumm-Heller
Date:  
To: pcre-dev
Subject: Re: [pcre-dev] setting up pcrecpp on win32
I spoke too soon, I seemed to have solved the problem. You need the
PCRE_STATIC preprocessor definition in your project.

Alex


-----Original Message-----
From: pcre-dev-bounces@??? [mailto:pcre-dev-bounces@exim.org] On
Behalf Of Krumm-Heller, Alex (ICT Centre, Marsfield)
Sent: Thursday, 27 September 2007 5:23 PM
To: pcre-dev@???
Subject: [pcre-dev] setting up pcrecpp on win32

Hi,



I am tying to use the latest version of the C++ wrapper for PCRE (7.4)
on Windows XP and am having a few problems getting a hello world example
to link against it. I have used CMake to build the Visual Studio.Net
2003 project files using all default values and have successfully built
PCRE. I then create a simple console program that has a simple main:



#include "pcrecpp.h"

int main(int argc, char* argv[])

{

            string group1, group2, group3, group4, group5;


            pcrecpp::RE
pat("(\\w+):([^/]*)/([^/]*)/([^;/][^;]*)(;.*)?");


            if (pat.FullMatch("hello", &group1, &group2, &group3,
&group4, &group5))


            {


                        printf("Matched\n");


            }




            return 0;


}



and am then linking it against the pcre.lib and the pcrecpp.lib files.



Unfortunately I am getting link errors:



testpcre.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: __thiscall pcrecpp::RE::~RE(void)"
(__imp_??1RE@pcrecpp@@QAE@XZ) referenced in function _main

testpcre.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: bool __thiscall
pcrecpp::RE::FullMatch(class pcrecpp::StringPiece const &,class
pcrecpp::Arg const &,class pcrecpp::Arg const &,class pcrecpp::Arg const
&,class pcrecpp::Arg const &,class pcrecpp::Arg const &,class
pcrecpp::Arg const &,class pcrecpp::Arg const &,class pcrecpp::Arg const
&,class pcrecpp::Arg const &,class pcrecpp::Arg const &,class
pcrecpp::Arg const &,class pcrecpp::Arg const &,class pcrecpp::Arg const
&,class pcrecpp::Arg const &,class pcrecpp::Arg const &,class
pcrecpp::Arg const &)const "
(__imp_?FullMatch@RE@pcrecpp@@QBE_NABVStringPiece@2@ABVArg@2@11111111111
1111@Z) referenced in function _main

testpcre.obj : error LNK2001: unresolved external symbol
"__declspec(dllimport) class pcrecpp::Arg pcrecpp::no_arg"
(__imp_?no_arg@pcrecpp@@3VArg@1@A)

testpcre.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: __thiscall
pcrecpp::StringPiece::StringPiece(char const *)"
(__imp_??0StringPiece@pcrecpp@@QAE@PBD@Z) referenced in function _main

testpcre.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: __thiscall pcrecpp::Arg::Arg(class
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > *)"
(__imp_??0Arg@pcrecpp@@QAE@PAV?$basic_string@DU?$char_traits@D@std@@V?$a
llocator@D@2@@std@@@Z) referenced in function _main

testpcre.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: __thiscall pcrecpp::RE::RE(char const *)"
(__imp_??0RE@pcrecpp@@QAE@PBD@Z) referenced in function _main

Debug/testpcre.exe : fatal error LNK1120: 6 unresolved externals



Can anybody point me to what I am doing wrong?



Thanks



Alex



--
## List details at http://lists.exim.org/mailman/listinfo/pcre-dev