Hi all,
I would want to create a simple program in C++ that allows to be connected to database Oracle 11g r2 Express. I'm Windows XP professional, I use Code:: Blocks with compiler MinGW (GCC for Windows).
The example code that I have written is the following:
#include <iostream>
#include <occi.h>
#define db_user_name "hr"
#define db_password "hr"
#define db_conn_str "giorgio:1521/xe"
using namespace std;
using namespace oracle::occi;
int main(void)
{
try {
Environment *env = Environment::createEnvironment(Environment::DEFAULT);
Connection *conn = env->createConnection(db_user_name, db_password, db_conn_str);
env->terminateConnection(conn);
Environment::terminateEnvironment(env);
}
catch(SQLException &sqlExcp) {
cerr << sqlExcp.getErrorCode() << sqlExcp.getMessage() << endl;
}
return 0;
}
in the compiler I indicate the path following:
C:\app\giorgik\product\11.2.0\client_1\oci\lib\msvc\vc9\oraocci11.lib
C:\app\giorgik\product\11.2.0\client_1\oci\include
I obtain this message of error:
obj\Release\main.o:main.cpp|| undefined reference to `oracle::occi::Environment::createEnvironment(oracle::occi::Environment::Mode, void*, void* (*)(void*, unsigned int), void* (*)(void*, void*, unsigned int), void (*)(void*, void*))'|
obj\Release\main.o:main.cpp|| undefined reference to `oracle::occi::Environment::terminateEnvironment(oracle::occi::Environment*)'|
||=== Build finished: 2 errors, 0 warnings ===|
where mistake ?
Edited by: giorgik on 24-mag-2012 19.39