首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在Linux中用g++编译OCCI

在Linux中用g++编译OCCI
EN

Stack Overflow用户
提问于 2012-06-12 15:46:50
回答 1查看 6.1K关注 0票数 0

我试图用OCCI库编译一个基本程序。

编译任务正常。

代码语言:javascript
复制
g++ -I. -g -I/opt/oracle/product/10.2.0/db_1/precomp/public -I/opt/oracle/product/10.2.0/db_1/rdbms/public -I/opt/oracle/product/10.2.0/db_1/rdbms/demo -I/opt/oracle/product/10.2.0/db_1/plsql/public -I/opt/oracle/product/10.2.0/db_1/network/public -DMAX_SEND_SIZE=2000   -c -o test.o test.cpp

输出正常,生成test.o。但是,当我想用以下命令链接对象文件时,

代码语言:javascript
复制
g++ -L/opt/oracle/product/10.2.0/db_1/lib/ -lclntsh -locci -o test test.o

链接任务失败,输出如下:

代码语言:javascript
复制
 test.o: In function `main':
/home/xxx/occi/test.cpp:128: undefined reference to `oracle::occi::Environment::createEnvironment(oracle::occi::Environment::Mode, void*, void* (*)(void*, unsigned int), void* (*)(void*, void*, unsigned int), void (*)(void*, void*))'
/home/xxx/occi/test.cpp:170: undefined reference to `oracle::occi::Environment::terminateEnvironment(oracle::occi::Environment*)'
/home/xxx/occi/test.cpp:158: undefined reference to `oracle::occi::SQLException::~SQLException()'
/home/xxx/occi/test.cpp:158: undefined reference to `oracle::occi::SQLException::SQLException(oracle::occi::SQLException const&)'
/home/xxx/occi/test.cpp:163: undefined reference to `oracle::occi::SQLException::what() const'
/home/xxx/occi/test.cpp:158: undefined reference to `oracle::occi::SQLException::~SQLException()'
test.o:(.gcc_except_table+0xe0): undefined reference to `typeinfo for oracle::occi::SQLException'
collect2: ld returned 1 exit status

我的环境简历:

Ubuntu 11.04

  • gcc版本4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3)

  • ORACLE_HOME = /opt/oracle/product/10.2.0/db_1

  • LD_LIBRARY_PATH = /opt/oracle/product/10.2.0/db_1/lib

  • Oracle版本: 10.2.0

)

你能帮我吗?,我真的需要在Linux中使用OCCI创建一个与Oracle的连接,我不想使用Pro*C。

EN

回答 1

Stack Overflow用户

发布于 2012-08-03 03:10:52

要使用OCCI,您需要安装Oracle提供的即时客户端(您安装了吗?)我使用Oracle 11.2,所以我的包含目录路径是/usr/ include /oracle/11.2/client64 64,我的共享库是/usr/lib/oracle/11.2/client64 64/lib。

我在这里看到的

代码语言:javascript
复制
http://173.255.217.246:8000/mapnik_trac/wiki/OCCI

10.2路径为/usr/lib/oracle/10.2.0.4/client/include和/usr/lib/oracle/10.2.0.4/client/lib

在11.2中,我还需要首先以http://xme.im/connect-oracle-database-eclipse-linux-using-occi的形式链接到http://xme.im/connect-oracle-database-eclipse-linux-using-occi

这是一个关于即时客户端http://oradim.blogspot.com/2009/08/getting-started-with-occi-linux-version.html的有用的博客描述

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/11000163

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档