我们在Pro*C中都有代码,并且在装有Red Hat Enterprise Linux Server版本7.5(Maipo)和Oracle 12 C的机器中,我们运行了它而没有错误:
proc SQLCHECK=SEMANTICS userid=letri/pruebas@desarrollo iname=carga_hr_fr include=. include=/usr/include include=/oracle/app/oracle/12.2.0/precomp/public include=/oracle/app/oracle/12.2.0/xdk/include include=/oracle/app/oracle/12.2.0/lib include=/oracle/app/oracle/12.2.0/lib include=/usr/lib/gcc/x86_64-redhat-linux/4.8.2/include/
cc -m64 -I. -I/usr/include -I/oracle/app/oracle/12.2.0/precomp/public -I/oracle/app/oracle/12.2.0/xdk/include -I/oracle/app/oracle/12.2.0/lib -I/oracle/app/oracle/12.2.0/lib -I/usr/lib/gcc/x86_64-redhat-linux/4.8.2/include/ -c carga_hr_fr.c
但是使用以下命令生成可执行文件:
cc -o carga_hr_fr carga_hr_fr.o /oracle/app/oracle/12.2.0/lib/libxml12.a -L/oracle/app/oracle/12.2.0/lib -L/oracle/app/oracle/12.2.0/xdk/include -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/include/ -lm -lclntsh
它生成错误:
/usr/bin/ld:/oracle/app/oracle/12.2.0/lib/libxml12.a(lpxsut.o): 对符号"LXGT2U"的未定义引用 /oracle/app/oracle/12.2.0/lib/libclntshcore.so.12.1:添加错误 符号:命令行中缺少 DSO,收集 2:错误:ld 返回 1 退出状态
关于如何解决它的任何想法?
这是代码的标头:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sqlda.h>
#include <sqlcpr.h>
#ifndef ORAXML_ORACLE
#include <oraxml.h>
#endif
#define DEFAULT_KEYWORD "death"
/*********** Conexion a Oracle *************/
#include "lib/liboracle.h"
#define USERID "dummy/something@development"
EXEC SQL INCLUDE sqlca;
/*****************************************/
将 -lnls12 添加到最后一个 cc 行。