使用OTL库编译时报错,请有经验的朋友指教

一个很简单的测试程序

#include <iostream>
using namespace std;
#include <stdio.h>


#define OTL_ORA11G 
#include "otlv4.h" 

otl_connect db; 

void select()

 otl_long_string f2(8000); 
 db.set_max_long_size(8000);


 otl_stream i(10, 
              "select f1, to_clob(f2) "
              "from test_tab "
              "where f1>=:f11<int> "
              " and f1<=:f12<int>*2",
                 // SELECT statement
              db // connect object
             );  
 int f1;
 i<<8<<8; 
 while(!i.eof()){ // while not end-of-data
  i>>f1>>f2;
  cout<<"f1="<<f1<<", f2="<<reinterpret_cast<char*>(&f2[0])<<endl;
 }
}


int main()
{
 otl_connect::otl_initialize(); // initialize OCI environment
   db.rlogon("test/test"); // connect to Oracle    
  select(); // select records from table
 db.logoff(); // disconnect from Oracle
 return 0;
}

=======================================================================

otlv4.h 在当前目录,也添加了 ...\oci\include和....\oci\lib\msvc 两个目录,oracle客户端是11g的。编译时就报一堆错误,如下:

1>main.obj : error LNK2019: unresolved external symbol _OCIHandleFree referenced in function "public: int __thiscall otl_conn::server_detach(void)" (?server_detach@otl_conn@@QAEHXZ)
1>main.obj : error LNK2019: unresolved external symbol _OCIServerDetach referenced in function "public: int __thiscall otl_conn::server_detach(void)" (?server_detach@otl_conn@@QAEHXZ)
1>main.obj : error LNK2019: unresolved external symbol _OCISessionEnd referenced in function "public: int __thiscall otl_conn::session_end(void)" (?session_end@otl_conn@@QAEHXZ)
1>main.obj : error LNK2019: unresolved external symbol _OCIInitialize referenced in function "public: static int __cdecl otl_conn::initialize(int)" (?initialize@otl_conn@@SAHH@Z)

。。。。


请高人指点一下啊!


阅读更多
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页