Ubuntu proc gcc典型问题


1.error: sqlca.h: No such file or directory

执行gcc -o test test.c时:

test.c:152:19: error: sqlca.h: No such file or directory

sqlca.h在$Oracle_HOME/precomp/public/下

更正后的命令:gcc -o test test.c -I $ORACLE_HOME/precomp/public

2.undefined reference to `sqlcxt'

执行5中的命令时出现错误如下:

test.c:(.text+0x5e5): undefined reference to `sqlcxt'

需要用到$ORACLE_HOME/lib/libclntsh.so

故需加上 -L $ORACLE_HOME/lib -l clntsh

更正后的命令为:

gcc -o test test.c -I /home/oracle/oracle/product/10.2.0/db_1/precomp/public -L $ORACLE_HOME/lib -l clntsh

3.proc着不到目录可执行

export LD_LIBRARY_PATH=$ORACLE_HOME/lib

相关内容