user-0 提问: Linux C调用ocilib错误

回复:
user: user-1
content: 引用 16 楼 xiaochende02 的回复:已经好使了 总结下问题： 可能存在问题，因为我也是稀里糊涂好的 1.我的oracle开发环境变量当初安装的时候在oracle这个用户下，root用户并没有oracle环境变量后来就在root下配置了一个全局的环境变量 2.可能Makefile写的不对，不过后来发现ocilib里面demo有自带的Makefile,那个拿出来该下就能编译 目前就发现这两点 替你总结一下经验教训吧： 使用任何开发环境或库，第零步：安装该开发环境或库，第一步：看Readme，第二步：看附带的例子，第三步：编译链接调试自带的例子，……

user: user-0
content: 已经好使了 总结下问题： 可能存在问题，因为我也是稀里糊涂好的 1.我的oracle开发环境变量当初安装的时候在oracle这个用户下，root用户并没有oracle环境变量后来就在root下配置了一个全局的环境变量 2.可能Makefile写的不对，不过后来发现ocilib里面demo有自带的Makefile,那个拿出来该下就能编译 目前就发现这两点

user: user-0
content: 引用 14 楼 zhao4zhong1 的回复:oracle数据库服务安装好 和 oracle数据库开发环境安装好 不是一回事！ 那估计是没装开发环境吧

user: user-1
content: oracle数据库服务安装好 和 oracle数据库开发环境安装好 不是一回事！

user: user-0
content: 引用 12 楼 zhao4zhong1 的回复:我严重怀疑你的oracle开发环境没安装好。 这个确定安装好了 我直接安装oracle服务器，可以对scott用户增删改查

user: user-1
content: 我严重怀疑你的oracle开发环境没安装好。

user: user-2
content: 引用 9 楼 xiaochende02 的回复:[quote=引用 8 楼 zhao4zhong1 的回复:] gcc -locilib -o conn conn.c 唉，不知道到底哪里配置到不对 我按你说到执行这个命令 gcc -locilib -o conn conn.c -L /usr/local/ocilib3.6/lib/  还是报错 ---------------------------------------------------------------------- /usr/bin/ld: warning: libclntsh.so.11.1, needed by /usr/local/ocilib3.6/lib//libocilib.so, not found (try using -rpath or -rpath-link) /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCICollGetElem' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDateTimeGetTimeZoneName' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCILobFlushBuffer' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCILobAppend' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIThreadMutexDestroy' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDateLastDay' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIThreadIdInit' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDirPathPrepare' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDateTimeIntervalSub' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIObjectGetInd' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIThreadIdDestroy' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIThreadJoin' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDateTimeCheck' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIThreadKeyInit' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDateTimeGetTimeZoneOffset' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCINumberToText' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIThreadHndDestroy' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIAttrSet' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIThreadMutexAcquire' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCICollAssignElem' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIArrayDescriptorFree' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCILobErase2' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDirPathColArrayEntrySet' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCISessionPoolDestroy' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCILobFileExists' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCILobCopy' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIConnectionPoolCreate' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCILobFileGetName' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDirPathStreamReset' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `xaoEnv' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIIntervalAssign' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIPing' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIIterPrev' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCILobFreeTemporary' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDateTimeSysTimeStamp' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCILobFileCloseAll' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIRefAssign' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCINumberFromInt' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDBShutdown' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIObjectNew' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIThreadHndInit' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDefineObject' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCILobLoadFromFile2' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCILobCreateTemporary' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCITransPrepare' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIArrayDescriptorAlloc' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIEnvCreate' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDescriptorAlloc' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIObjectUnpin' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIObjectGetObjectRef' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDateTimeCompare' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIObjectFree' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCILobWrite' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDateTimeConstruct' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCILobGetChunkSize' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIStmtFetch2' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIStmtGetPieceInfo' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCILobEnableBuffering' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIConnectionPoolDestroy' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIIntervalFromText' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDateNextDay' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDateTimeConvert' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDateDaysBetween' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCICollSize' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCISessionEnd' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCILobTrim' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `xaoSvcCtx' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIThreadKeyDestroy' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCILobGetLength2' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDateTimeGetDate' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCILobWriteAppend2' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCISubscriptionUnRegister' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCISessionRelease' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCILobIsTemporary' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDateTimeSubtract' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIHandleAlloc' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDirPathFinish' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIStringPtr' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIThreadClose' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIObjectPin' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIRefClear' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCISessionBegin' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIStmtFetch' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDateTimeToText' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIStmtPrepare' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIErrorGet' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCISubscriptionRegister' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDBStartup' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIThreadMutexInit' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCILobClose' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCICollAppend' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCILobWrite2' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCILobIsEqual' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDateTimeAssign' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDirPathAbort' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIAQListen' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIIntervalSetDaySecond' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIParamGet' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDateTimeGetTime' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIRefToHex' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDateTimeIntervalAdd' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDateAddDays' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIBindByName' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCILobWriteAppend' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCILobLocatorAssign' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIStringAssignText' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIThreadKeySet' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIIntervalFromTZ'  /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCILobDisableBuffering' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIIterDelete' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDirPathFlushRow'[/quote] 你这个libocilib.so应该是基于OCI二次开发出来的一个库，你还要链接上OCI动态库liboci.so

user: user-3
content: 还要加 -lclntsh这个把，其实这些是要写Makefile的

user: user-0
content: 引用 8 楼 zhao4zhong1 的回复:gcc -locilib -o conn conn.c 唉，不知道到底哪里配置到不对 我按你说到执行这个命令 gcc -locilib -o conn conn.c -L /usr/local/ocilib3.6/lib/  还是报错 ---------------------------------------------------------------------- /usr/bin/ld: warning: libclntsh.so.11.1, needed by /usr/local/ocilib3.6/lib//libocilib.so, not found (try using -rpath or -rpath-link) /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCICollGetElem' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDateTimeGetTimeZoneName' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCILobFlushBuffer' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCILobAppend' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIThreadMutexDestroy' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDateLastDay' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIThreadIdInit' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDirPathPrepare' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDateTimeIntervalSub' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIObjectGetInd' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIThreadIdDestroy' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIThreadJoin' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDateTimeCheck' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIThreadKeyInit' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDateTimeGetTimeZoneOffset' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCINumberToText' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIThreadHndDestroy' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIAttrSet' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIThreadMutexAcquire' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCICollAssignElem' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIArrayDescriptorFree' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCILobErase2' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDirPathColArrayEntrySet' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCISessionPoolDestroy' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCILobFileExists' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCILobCopy' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIConnectionPoolCreate' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCILobFileGetName' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDirPathStreamReset' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `xaoEnv' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIIntervalAssign' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIPing' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIIterPrev' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCILobFreeTemporary' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDateTimeSysTimeStamp' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCILobFileCloseAll' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIRefAssign' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCINumberFromInt' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDBShutdown' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIObjectNew' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIThreadHndInit' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDefineObject' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCILobLoadFromFile2' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCILobCreateTemporary' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCITransPrepare' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIArrayDescriptorAlloc' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIEnvCreate' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDescriptorAlloc' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIObjectUnpin' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIObjectGetObjectRef' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDateTimeCompare' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIObjectFree' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCILobWrite' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDateTimeConstruct' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCILobGetChunkSize' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIStmtFetch2' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIStmtGetPieceInfo' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCILobEnableBuffering' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIConnectionPoolDestroy' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIIntervalFromText' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDateNextDay' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDateTimeConvert' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDateDaysBetween' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCICollSize' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCISessionEnd' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCILobTrim' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `xaoSvcCtx' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIThreadKeyDestroy' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCILobGetLength2' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDateTimeGetDate' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCILobWriteAppend2' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCISubscriptionUnRegister' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCISessionRelease' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCILobIsTemporary' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDateTimeSubtract' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIHandleAlloc' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDirPathFinish' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIStringPtr' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIThreadClose' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIObjectPin' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIRefClear' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCISessionBegin' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIStmtFetch' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDateTimeToText' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIStmtPrepare' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIErrorGet' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCISubscriptionRegister' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDBStartup' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIThreadMutexInit' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCILobClose' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCICollAppend' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCILobWrite2' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCILobIsEqual' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDateTimeAssign' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDirPathAbort' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIAQListen' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIIntervalSetDaySecond' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIParamGet' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDateTimeGetTime' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIRefToHex' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDateTimeIntervalAdd' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDateAddDays' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIBindByName' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCILobWriteAppend' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCILobLocatorAssign' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIStringAssignText' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIThreadKeySet' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIIntervalFromTZ'  /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCILobDisableBuffering' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIIterDelete' /usr/local/ocilib3.6/lib//libocilib.so: undefined reference to `OCIDirPathFlushRow'

user: user-1
content: gcc -locilib -o conn conn.c

user: user-1
content: -L(.so所在目录) -lXXX

user: user-0
content: 引用 5 楼 zhao4zhong1 的回复:-lXXX 其中XXX对应 libXXX.so  对楼主来说XXX=ocilib -locilib 我直接在后面跟上-locilib，执行提示没找着

user: user-1
content: -lXXX 其中XXX对应 libXXX.so  对楼主来说XXX=ocilib -locilib

user: user-0
content: 引用 3 楼 user-3 的回复:-locilib，要加类似这个，看你lib库的名字 这是lib库

user: user-3
content: -locilib，要加类似这个，看你lib库的名字

user: user-0
content: 引用 1 楼 zhao4zhong1 的回复:export ORACLE_HOME=/opt/oracle/product/9.2.0 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib 你说的这个我已经配置了

user: user-1
content: export ORACLE_HOME=/opt/oracle/product/9.2.0 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib