title: C++ / Mysql Connector : undefined reference to `get_driver_instance'
body: <p>I've found some topics on this forum concerning the same error, but I didn't find the solution in it.</p>
  
  <p>I'm trying to make work C++ &amp; Mysql Connector on Ubuntu 11.04.
  My error is (after following official Mysql tutorial)</p>
  
  <pre><code>/tmp/ccDmH4pd.o: In function `main':
  mysql.cpp:(.text+0xb): undefined reference to `get_driver_instance'
  collect2: ld returned 1 exit status
  </code></pre>
  
  <p>Here is my code :</p>
  
  <pre><code>int main(){     
      sql::Driver*        driver; // Create a pointer to a MySQL driver object
      sql::Connection*    dbConn; // Create a pointer to a database connection object
      sql::Statement*     stmt;   // Create a pointer to a Statement object to hold our SQL commands
      sql::ResultSet*     res;    // Create a pointer to a ResultSet object to hold the results of any queries we run
  
      driver = get_driver_instance();
      dbConn = driver-&gt;connect(server, username, password);
  
  
          delete dbConn;
          return 0;
      }
  </code></pre>
  
  <p>Here are my includes :</p>
  
  <pre><code>#include "mysql_driver.h"
  #include "mysql_connection.h"
  
  // Include the Connector/C++ headers
  #include "cppconn/driver.h"
  #include "cppconn/exception.h"
  #include "cppconn/resultset.h"
  #include "cppconn/statement.h"
  </code></pre>
  
  <p>Thanks in advance everybody</p>
  
  <p>Touki</p>