OCI(Oracle Call Interface)链接错误 - visual studio 2012

时间:2014-01-07 07:20:28

标签: c++ oracle oci soci

我试图编译在Windows下使用OCI(Oracle Call Interface)的SOCI(http://soci.sourceforge.net/)。

详细信息:Visual Studio 2012,Oracle版本11.2.0; 64位

我找到了$(ORCALE_HOME)/OCI/LIB/MSVC个库。但它不会喜欢(我尝试了oraocci11.liboci.lib

我得到的链接错误:

2>blob.obj : error LNK2019: unresolved external symbol _OCIDescriptorAlloc referenced in function "public: __thiscall soci::oracle_blob_backend::oracle_blob_backend(struct soci::oracle_session_backend &)" (??0oracle_blob_backend@soci@@QAE@AAUoracle_session_backend@1@@Z)
2>row-id.obj : error LNK2001: unresolved external symbol _OCIDescriptorAlloc
2>blob.obj : error LNK2019: unresolved external symbol _OCIDescriptorFree referenced in function "public: virtual __thiscall soci::oracle_blob_backend::~oracle_blob_backend(void)" (??1oracle_blob_backend@soci@@UAE@XZ)
2>row-id.obj : error LNK2001: unresolved external symbol _OCIDescriptorFree
2>blob.obj : error LNK2019: unresolved external symbol _OCILobGetLength referenced in function "public: virtual unsigned int __thiscall soci::oracle_blob_backend::get_len(void)" (?get_len@oracle_blob_backend@soci@@UAEIXZ)
2>blob.obj : error LNK2019: unresolved external symbol _OCILobRead referenced in function "public: virtual unsigned int __thiscall soci::oracle_blob_backend::read(unsigned int,char *,unsigned int)" (?read@oracle_blob_backend@soci@@UAEIIPADI@Z)
2>blob.obj : error LNK2019: unresolved external symbol _OCILobTrim referenced in function "public: virtual void __thiscall soci::oracle_blob_backend::trim(unsigned int)" (?trim@oracle_blob_backend@soci@@UAEXI@Z)
2>blob.obj : error LNK2019: unresolved external symbol _OCILobWrite referenced in function "public: virtual unsigned int __thiscall soci::oracle_blob_backend::write(unsigned int,char const *,unsigned int)" (?write@oracle_blob_backend@soci@@UAEIIPBDI@Z)
2>blob.obj : error LNK2019: unresolved external symbol _OCILobWriteAppend referenced in function "public: virtual unsigned int __thiscall soci::oracle_blob_backend::append(char const *,unsigned int)" (?append@oracle_blob_backend@soci@@UAEIPBDI@Z)
2>error.obj : error LNK2019: unresolved external symbol _OCIErrorGet referenced in function "void __cdecl soci::details::oracle::get_error_details(int,struct OCIError *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &,int &)" (?get_error_details@oracle@details@soci@@YAXHPAUOCIError@@AAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAH@Z)
2>session.obj : error LNK2019: unresolved external symbol _OCIEnvCreate referenced in function "public: __thiscall soci::oracle_session_backend::oracle_session_backend(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,int,bool)" (??0oracle_session_backend@soci@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00H_N@Z)
2>session.obj : error LNK2019: unresolved external symbol _OCIHandleAlloc referenced in function "public: __thiscall soci::oracle_session_backend::oracle_session_backend(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,int,bool)" (??0oracle_session_backend@soci@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00H_N@Z)
2>statement.obj : error LNK2001: unresolved external symbol _OCIHandleAlloc
2>vector-into-type.obj : error LNK2001: unresolved external symbol _OCIHandleFree
2>vector-use-type.obj : error LNK2001: unresolved external symbol _OCIHandleFree
2>session.obj : error LNK2019: unresolved external symbol _OCIHandleFree referenced in function "public: void __thiscall soci::oracle_session_backend::clean_up(void)" (?clean_up@oracle_session_backend@soci@@QAEXXZ)
2>standard-into-type.obj : error LNK2001: unresolved external symbol _OCIHandleFree
2>standard-use-type.obj : error LNK2001: unresolved external symbol _OCIHandleFree

任何想法?我真的坚持那个。

谢谢,盖伊

1 个答案:

答案 0 :(得分:0)

好吧,我发现最终我可以链接oci.lib(“即时客户端套餐”)

http://www.oracle.com/technetwork/topics/winsoft-085727.html