Chinaunix首页 | 论坛 | 博客
  • 博客访问: 791499
  • 博文数量: 185
  • 博客积分: 7434
  • 博客等级: 少将
  • 技术积分: 2325
  • 用 户 组: 普通用户
  • 注册时间: 2005-12-29 14:01
文章分类

全部博文(185)

文章存档

2013年(1)

2012年(2)

2011年(17)

2010年(25)

2009年(36)

2008年(104)

分类: LINUX

2009-04-29 10:36:16

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.

阅读(1710) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~