title: Error at compiling Oracle Database Environment in c++ on codeblocks
body: <p>I am trying to develop a two-tier program, and for that, I need to connect my program to a database (Oracle in this case), through the <code>OCCI</code> interface using connection pools. I have linked the <code>occi.h</code> header file and directory in CodeBlocks already, but when I try to compile, it displays this error:</p>
  
  <blockquote>
    <p>|undefined reference to `oracle::occi::Environment::createEnvironment(oracle::occi::Environment::Mode, void*, void* (<em>)(void</em>, unsigned int), void* (<em>)(void</em>, void*, unsigned int), void (<em>)(void</em>, void*))'|</p>
    
    <p>||undefined reference to `oracle::occi::Environment::terminateEnvironment(oracle::occi::Environment*)'|</p>
    
    <p>||error: ld returned 1 exit status|
    ||=== Build failed: 3 error(s), 0 warning(s) (0 minute(s), 2 second(s)) ===|</p>
  </blockquote>
  
  <p>Does anyone understand what this error means? I'm no ace C++ programmer, so please bear with me!</p>
  
  <p>This is a demo code where the error occurs:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;occi.h&gt;
  #include &lt;iomanip&gt;
  using namespace oracle::occi;
  using namespace std;
  
  class occipool {
    private:
     Environment* env;
     Connection* con;
    Statement* stmt;
  
   public:
   /**
   * Constructor for the occipool test case.
   */
    occipool() {
      env = Environment::createEnvironment(Environment::DEFAULT);
    }    // end of constructor occipool ()
  
   /**
  * Destructor for the occipool test case.
  */
   ~occipool() {
    Environment::terminateEnvironment(env);
   }    // end of ~occipool ()
  
   /**
  * The testing logic of the test case.
  */
   dvoid select() {
  cout &lt;&lt; "occipool - Selecting records using ConnectionPool interface"
       &lt;&lt; endl;
  const string poolUserName = "name";
  const string poolPassword = "password";
  const string connectString = "name";
  const string username = "name";
  const string passWord = "password";
  unsigned int maxConn = 5;
  unsigned int minConn = 3;
  unsigned int incrConn = 2;
  ConnectionPool* connPool = env-&gt;createConnectionPool(
      poolUserName, poolPassword, connectString, minConn, maxConn, incrConn);
  try {
    if (connPool)
      cout &lt;&lt; "SUCCESS - createConnectionPool" &lt;&lt; endl;
    else
      cout &lt;&lt; "FAILURE - createConnectionPool" &lt;&lt; endl;
    con = connPool-&gt;createConnection(username, passWord);
    if (con)
      cout &lt;&lt; "SUCCESS - createConnection" &lt;&lt; endl;
    else
      cout &lt;&lt; "FAILURE - createConnection" &lt;&lt; endl;
  } catch (SQLException ex) {
    cout &lt;&lt; "Exception thrown for createConnectionPool" &lt;&lt; endl;
    cout &lt;&lt; "Error number: " &lt;&lt; ex.getErrorCode() &lt;&lt; endl;
    cout &lt;&lt; ex.getMessage() &lt;&lt; endl;
  }
  
  cout &lt;&lt; "retrieving the data" &lt;&lt; endl;
  stmt = con-&gt;createStatement("SELECT ID, dept_name FROM p_worker");
  ResultSet* rset = stmt-&gt;executeQuery();
  while (rset-&gt;next()) {
    cout &lt;&lt; "author_id:" &lt;&lt; rset-&gt;getInt(1) &lt;&lt; endl;
    cout &lt;&lt; "author_name:" &lt;&lt; rset-&gt;getString(2) &lt;&lt; endl;
  }
  stmt-&gt;closeResultSet(rset);
  con-&gt;terminateStatement(stmt);
  connPool-&gt;terminateConnection(con);
  env-&gt;terminateConnectionPool(connPool);
  
  cout &lt;&lt; "occipool - done" &lt;&lt; endl;
  }  // end of test (Connection *)
  
  };  // end of class occipool
  
    int main(void) {
   string user = "name";
   string passwd = "password";
   string db = "name";
  
   occipool* demo = new occipool();
  
   demo-&gt;select();
   delete demo;
  
    }  // end of main ()
  </code></pre>