ociuldr在32位机器可以运行,但是在64位不能运行

本文解决了一个在Linux环境下使用OCIuldr时遇到的问题,包括如何正确配置32位和64位编译命令,以确保与Oracle数据库库文件兼容。提供了在不同操作系统上编译OCI程序的具体步骤。

 http://www.itpub.net/thread-1019442-1-1.html

ociuldr在linux下的问题

想在linux下使用的ociuldr,发现几个问题:

1.编译的是32位的,需要32 位的oracle 库文件,而我在64位上如下使用。

2.我下载了源程序。
URL  http://www.anysql.net/software/ociuldr.c

想自己编译看看。

打入
gcc ociuldr.c

弹出一大堆错误。或者我的编译有问题。

谢谢!

---------------------------------------------------------------------------------------------------------------------------------------------

目前测试在windows32位机器上可以运行,但是在windows64位机器上不能运行,

通过网络查找,在http://www.dbatools.net/experience/compile_oci_program.html 有提示

 

 

How to compile Oracle Call Interface (OCI) program?

Links: http://www.dbatools.net/experience/compile_oci_program.html

    On Linux/Unix we can use gcc to compile OCI source code. Use the following command to compile the text unload utility as 64 bit binary.

gcc -m64 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -I${ORACLE_HOME}/rdbms/public -I${ORACLE_HOME}/rdbms/demo -L${ORACLE_HOME}/lib -lclntsh -o ociuldr.bin ociuldr.c

    I usually compile it as 32 bit executable file by the following command.

gcc -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -I${ORACLE_HOME}/rdbms/public -I${ORACLE_HOME}/rdbms/demo -L${ORACLE_HOME}/lib32 -lclntsh -o ociuldr.bin ociuldr.c

    On IBM AIX, you need to use the following command to compile ociuldr to support 64 bit IO feature.

gcc -D_LARGE_FILES -I${ORACLE_HOME}/rdbms/public -I${ORACLE_HOME}/rdbms/demo -L${ORACLE_HOME}/lib32 -lclntsh -o ociuldr.bin ociuldr.c

    On windows, I will use Microsoft Visual C++ as compiler. Run the following command to compile it.

set ORACLE_HOME=c:/oracle/product/10.2.0
set INCLUDE=%LIB%;%ORACLE_HOME%/oci/include
set LIB=%INCLUDE%;%ORACLE_HOME%/oci/lib/msvc
cl /ML /Feociuldr.exe ociuldr.c oci.lib

    For the Pro*C compilation, you just need to change the include file path and library path.

 

 

 

 

 

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值