开发环境:VS2015 64位
库文件路径:sdk/lib/msvc/vc14(注意千万不要用最外层那个,那个是默认版本VC10)
环境变量可以不用配置,直接把basic下的所有dll文件拷贝至工程生成的可执行文件目录下
官方描述:https://docs.oracle.com/database/121/LNCPP/install.htm#LNCPP20104
Using OCCI with Microsoft Visual C++
The Oracle Database 12c Release 1 (12.1) includes OCCI libraries for developing applications with Microsoft Visual C++ version 10.0 (.NET 2010 SP1 10.0), Microsoft Visual C++ version 11.0 (.NET 2012 11.0), Microsoft Visual C++ version 12.0 (.NET 2013 12.0), and Intel 12.1 C compilers with Microsoft Visual Studio 2010 STLs. Microsoft Visual C++ version 8.0 and version 9.0 are no longer supported.
Microsoft Visual C++ version 10.0 libraries are installed in the following default locations:
ORACLE_BASE\ORACLE_HOME\bin\oraocci12.dll ORACLE_BASE\ORACLE_HOME\oci\lib\msvc\oraocci12.libCopies of these two files are also installed under the directory:
ORACLE_BASE\ORACLE_HOME\oci\lib\msvc\vc10Microsoft Visual C++ 2012 OCCI libraries are installed in the following default location:
ORACLE_BASE\ORACLE_HOME\oci\lib\msvc\vc11When developing OCCI applications with MSVC++ 2012, ensure that the OCCI libraries are correctly selected from this directory for linking and executing.
Microsoft Visual C++ 2013 OCCI libraries are installed in the following default location:
ORACLE_BASE\ORACLE_HOME\oci\lib\msvc\vc12When developing OCCI applications with MSVC++ 2013, ensure that the OCCI libraries are correctly selected from this directory for linking and executing.
Applications should link with the appropriate OCCI library. You must ensure that the corresponding DLL is located in the Windows system PATH.
Applications that link to
MSVCRTD.DLL
, a debug version of Microsoft C-Runtime,/MDd
compiler flag, should link with these specific OCCI libraries:oraocci12d.lib
andoraocci12d.dll
.All Instant Client packages contain the versions of the OCCI DLLs that are compatible with Microsoft Visual C++ version 10.0.
OCCI相关下载(Oracle1202 SDK、Basic):
链接:https://pan.baidu.com/s/1KcJWvEJ5T0hQzP4h61KJ5Q
提取码:wbfw
#include
#include
代码仅做参考!