It shows error message Cannot create OCI environment in my Visual c++ -
i using microsoft visualstudio2015, trying run c++ program using oci functions, program terminating.
i set ocilib path in visual studio , starting successfully, got message initialising failed in log file
#include "ocilib.h" ofstream logfile; logfile.open("logfile.txt"); void err_handler(oci_error *err) { if(oci_errorgettype(err) == oci_err_oracle) { const mtext* sql =oci_getsql(oci_errorgetstatement(err)); if(sql != null) { logfile<<"error - sql : "<<sql<<"\n"; } } logfile<<"error - msg : "<<oci_errorgetstring(err)<<endl; ++nbr_error; } if(!oci_initialize(err_handler, null, oci_env_default)) { logfile<<"error - initialise failed\n"; exit(1); }
after running program shows error - msg: cannot create oci environment program terminating,
what supposed do.
download instantclient-basic , instantclient-sdk-windows http://www.oracle.com/technetwork/cn/topics/winsoft-085727.html.
you should choose x86 or x64 version based on program. , decompress , merge them 1 folder.
in program, oci_initialize(err_handler, the_folder, oci_env_default)
Comments
Post a Comment