title: How do I get PCRE to work with C++?
body: <p>This is a newbie question but I hope I can express my question as clearly as possible.</p>
  
  <p>I'm trying to do pattern matching in C++. </p>
  
  <p>I've downloaded the Win32 version of PCRE from <a href="http://gnuwin32.sourceforge.net/packages/pcre.htm" rel="noreferrer">here</a> and I've placed the downloaded pcre3.dll and pcreposix3.dll files into the folder of Dev-CPP's lib folder (I'm using Bloodshed Dev-C++ 4.9.9 IDE). </p>
  
  <p>I've also downloaded a pcrecpp.h header file and have it in the same directory I'm writing the following code (not writing actually. I'm coping example code from a PDF tutorial named PCRE- Perl Compatible Regular Express). </p>
  
  <p>But I can't get it to work. The code is as follows: </p>
  
  <pre><code>    #include &lt;iostream&gt;
      #include &lt;string&gt;
      #include &lt;pcrecpp.h&gt;
  
      using namespace std;
  
      int main()
      {
         int i;
         string s;
         pcrecpp::RE re("(\\w+):(\\d+)");
         if (re.error().length() &gt; 0) {
            cout &lt;&lt; "PCRE compilation failed with error: " &lt;&lt; re.error() &lt;&lt; "\n";
         }
         if (re.PartialMatch("root:1234", &amp;s, &amp;i))
         cout &lt;&lt; s &lt;&lt; " : " &lt;&lt; i &lt;&lt; "\n";
      }
  </code></pre>
  
  <p>When I compile the code, Dev-C++ gives me a lot of errors including: "`pcrecpp' has not been declared" and "RE" undeclared.</p>
  
  <p>How should I deal with the downloaded files and fix my problem? Or is there something obvious that I'm missing? </p>