title: Poco RWLock - Undefined reference to 'pthread_rwlock_wrlock@@GLIBC_2.2.5
body: <p>I'm building a daemon application on Ubuntu 14.04 x64 and i get a linker error:</p>
  
  <pre><code>undefined reference to symbol 'pthread_rwlock_wrlock@@GLIBC_2.2.5'
  </code></pre>
  
  <p>The code is</p>
  
  <pre><code>#include &lt;Poco/RWLock.h&gt;
  
  class DatabaseHandler
  {
  public:
  
    typedef std::shared_ptr&lt;DatabaseHandler&gt; Ptr;
  
    DatabaseHandler() {};
    virtual ~DatabaseHandler() {};
  
    virtual bool Connect(const STRING&amp; connstring);
    bool Disconnect();
  
    BOOL IsConnected() {
      return (m_pSession &amp;&amp; m_pSession-&gt;isConnected());
    }
  
  protected:
    std::unique_ptr&lt;Poco::Data::Session&gt; m_pSession;
    Poco::RWLock m_write_lock;
  };
  
  
  class FADatabaseHandler : public DatabaseHandler
  {
  public:
    EDBReturnValues UpdateHouse(TFAData&amp; data);
  
  private:
    BOOL HouseExists(const UINT HouseId);
  };
  </code></pre>
  
  <p>And the implementation..</p>
  
  <pre><code>EDBReturnValues FADatabaseHandler::UpdateHouse(TFAData&amp; data)
  {
    Poco::ScopedWriteRWLock lock(m_write_lock);
    .....
  }
  </code></pre>
  
  <p>The compiler command line for this file is</p>
  
  <pre><code>g++ -Wall -fexceptions -std=c++11 -g -lrt -lm -lpthread -DPOCO_STATIC -DPOCO_NO_AUTOMATIC_LIBS -DUSING_POCO_LIB -DBUILD_AS_SERVER -I/usr/local/mysql/include -c /home/daniele/src/TBServer/FADatabaseHandler.cpp -o obj/Debug/FADatabaseHandler.o
  </code></pre>
  
  <p>If I comment the RWLock.h include, the m_write_lock and the ScopedWriteRWLock calls, I get the error in:</p>
  
  <pre><code>/usr/bin/ld: /usr/local/lib/libPocoFoundationd.a(TextEncoding.o): undefined reference to symbol 'pthread_rwlock_wrlock@@GLIBC_2.2.5'
  </code></pre>
  
  <p>Where I'm wrong?</p>
  
  <p>Regards.</p>