title: Trying to use OTL to connect to my PostgreSQL server
body: <p>I am trying to connect my c++ client to an PostgreSQL DB.  I keep getting otlv4.h|12406|undefined reference to `SQLFreeHandle@8' and many other undefined reference errors.</p>
  
  <p>To get the header file go to <a href="http://otl.sourceforge.net/otl3_down.htm" rel="nofollow">http://otl.sourceforge.net/otl3_down.htm</a></p>
  
  <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  
  #include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  #include &lt;stdlib.h&gt;
  // #define OTL_ODBC_UNIX // uncomment this line if UnixODBC is used
  #define OTL_ODBC_ALTERNATE_RPC
  #if !defined(_WIN32) &amp;&amp; !defined(_WIN64)
  #define OTL_ODBC
  #else
  #define OTL_ODBC_POSTGRESQL // required with PG ODBC on Windows
  #endif
  #include "otlv4.h" // include the OTL 4.0 header file
  
  otl_connect db; // connect object
  
  int main()
  {
  
      otl_connect::otl_initialize(); // initialize ODBC environment
  
      db.rlogon("postgres/changeme@numbers");
  
      db.commit();
  
      cout &lt;&lt; "Hello world!" &lt;&lt; endl;
  
      db.logoff(); // disconnect from ODBC
      return 0;
  }
  </code></pre>