Can someone please tell me what I am missing?
I downloaded Oracle instantclient-basic-nt-12.1.0.1.0.zip and instantclient-sdk-nt-12.1.0.1.0.zip and extracted both to c:\oracle\
I then went into visual studio 2013 and created a Win32 Console application with all default parms.
I then went into project -> properties -> C/C++ -> General -> Additional Include Directories and added my include path C:\oracle\sdk\include
I then went into project -> properties -> Linker -> General -> Additional Library Directories and added C:\oracle\sdk\lib\msvc\vc11
I then went into project -> properties -> Linker -> Input -> Additional Dependancies and added oraocci12.lib
The program compiles but when I debug i get a RUNTIME error that says "The program can't start because oraocci12.dll is missing from your computer. Try reinstalling the program to fix this problem. But I know the file exists in C:\oracle\sdk\lib\msvc\vc11\oraocci12.lib
What am I doing wrong? Any help is greatly appreciated!
This is the code if it makes a difference
Code:
#include "stdafx.h"
#include <iostream>
#include <occi.h>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
oracle::occi::Environment* environment;
oracle::occi::Connection *con;
oracle::occi::Statement* stmt;
oracle::occi::ResultSet* res;
try{
environment = oracle::occi::Environment::createEnvironment(oracle::occi::Environment::DEFAULT);
con = environment->createConnection("gldbuser", "gldbuser", "MYDATABSE");
stmt = con->createStatement("select * from example");
res = stmt->executeQuery();
while (res->next())
std::cout << res->getInt(1) << " " << res->getString(2) << std::endl;
stmt->closeResultSet(res);
con->terminateStatement(stmt);
environment->terminateConnection(con);
}
catch (oracle::occi::SQLException &e){
std::cout << e.what();
}
return 0;
}