Pro*C / Pro*Cobol / OCI / OCCI: Building Static Demos Fails During Link Stage With Unresolved Symbols After upgrading From Oracle 9iR2 (9.2.0.X) or Lower to Oracle 10gR1 (10.1.0.2) or Higher (Doc ID 1252634.1)

Last updated on JULY 03, 2017

Applies to:

Oracle Database - Enterprise Edition - Version 10.1.0.2 and later
Precompilers - Version 10.1.0.2 and later
Generic UNIX
***Checked for relevance on 2nd Feb 2016***

Symptoms

After upgrading from Oracle 9iR2 (9.2.0.X) or lower to Oracle 10gR1 (10.1.0.2) or higher and trying to build statically linked Pro*C / Pro*Cobol / OCI / OCCI demos on Unix/Linux  using commands like

make -f demo_proc.mk build_static EXE=sample1 OBJS=sample1.o
make -f demo_procob.mk build_static EXE=sample1 COBS=sample1.cob
make -f demo_rdbms.mk build_static EXE=sample1 OBJS=sample1.o
make -f demo_rdbms.mk buildocci_static EXE=sample1 OBJS=sample1.o


fails during link stage by

Pro*C

make t1.o: In function `sql_error':
t1.c:(.text+0x41): undefined reference to `sqlglm'
t1.c:(.text+0xd1): undefined reference to `sqlcxt'
t1.o: In function `main':
t1.c:(.text+0x346): undefined reference to `sqlcxt'
t1.c:(.text+0x63a): undefined reference to `sqlcxt'
t1.c:(.text+0x75b): undefined reference to `sqlcxt'
collect2: ld returned 1 exit status
make: *** [build_static] Error 1


Pro*Cobol

HP-UX

ld: Mismatched ABI (not an ELF file) for -lclntst11, found /emea/tools/64bit/app
/oracle/product/11.2.0/lib//libclntst11.a
Fatal error.

AIX

ld: 0711-711 ERROR: Input file /emea/tools/64bit/app/oracle/product/11.2.0/lib//
libclntst11.a is empty.
The file is being ignored.
make: 1254-004 The error code from the last command is 8.


OCI

sample1.o: In function `main':
sample1.c:(.text+0xd8): undefined reference to `OCIEnvCreate'
sample1.c:(.text+0x122): undefined reference to `OCIHandleAlloc'
sample1.c:(.text+0x145): undefined reference to `OCIHandleAlloc'
sample1.c:(.text+0x168): undefined reference to `OCIHandleAlloc'
sample1.c:(.text+0x18d): undefined reference to `OCIServerAttach'
sample1.c:(.text+0x1ba): undefined reference to `OCIAttrSet'

...........

sample1.c:(.text+0xd59): undefined reference to `OCIStmtExecute'
sample1.c:(.text+0xdcb): undefined reference to `OCITransCommit'
sample1.o: In function `checkerr':
sample1.c:(.text+0xf3b): undefined reference to `OCIErrorGet'
sample1.o: In function `cleanup':
sample1.c:(.text+0xfa5): undefined reference to `OCIHandleFree'
collect2: ld returned 1 exit status
make: *** [build_static] Error 1


OCCI

$ORACLE_HOME/lib//libocci11.a(occiSQLException.o): In function `oracle::occi::HeapAlloc<oracle::occi::RefCounted>::operator delete(void
*, void*, unsigned char const*)':
occiSQLException.cpp:(.gnu.linkonce.t._ZN6oracle4occi9HeapAllocINS0_10RefCounted
EEdlEPvS4_PKh[.gnu.linkonce.t._ZN6oracle4occi9HeapAllocINS0_10RefCountedEEdlEPvS
4_PKh]+0x18): undefined reference to `OCIPHeapFree'

.....

$ORACLE_HOME/lib//libocci11.a(occiAnyDataImpl.o): In function `_ZN6oracle4occi11AnyDataImplC9EPKNS0_10ConnectionEP10OCIAnyDatab':
occiAnyDataImpl.cpp:(text.unlikely+0x4294): undefined reference to `OCIPAnyDataS
etUCIOptMode'
collect2: ld returned 1 exit status
make: *** [buildocci_static] Error 1

 

Changes

Upgrade from 9iR2(9.2.0.X) or lower  to 10gR1(10.1.0.2) or higher

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms