I am looking at using pcre2 in my simple c++ app, (I am using vs2015). (I am looking at various regex libraries and the general feeling is that pcre/pcre2 are the most flexible)
First I downloaded pcre2 from the official location, (http://sourceforge.net/projects/pcre/files/pcre2/10.20/) and created a very simple example.
#define PCRE2_CODE_UNIT_WIDTH 8
#include <pcre2.h>
...
PCRE2_SPTR subject = (PCRE2_SPTR)std::string("this is it").c_str();
PCRE2_SPTR pattern = (PCRE2_SPTR)std::string("([a-z]+)|\\s").c_str();
...
int errorcode;
PCRE2_SIZE erroroffset;
pcre2_code *re = pcre2_compile(pattern, PCRE2_ZERO_TERMINATED,
PCRE2_ANCHORED | PCRE2_UTF, &errorcode,
&erroroffset, NULL);
...
First of all the file "pcre2.h" does not exist, so I renamed pcre2.h.generic to pcre2.h
But then I get linker errors with unresolved externals.
I am guessing I need to include one or more files from the source to project. But I am reluctant to just randomly add files without knowing what it all does.
Can someone give some simple steps to follow to successfully build a project using pcre2?
UPDATE
This is not an import library issue, pcre2.h does not come with a librar, (not one that I can see in their release location).
In case someone wants to build the library using visual studio
Compile and the lib file should be created fine.