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 ( or Higher (Doc ID 1252634.1)

Last updated on JULY 03, 2017

Applies to:

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


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

make -f build_static EXE=sample1 OBJS=sample1.o
make -f build_static EXE=sample1 COBS=sample1.cob
make -f build_static EXE=sample1 OBJS=sample1.o
make -f buildocci_static EXE=sample1 OBJS=sample1.o

fails during link stage by


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



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


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.


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


$ORACLE_HOME/lib//libocci11.a(occiSQLException.o): In function `oracle::occi::HeapAlloc<oracle::occi::RefCounted>::operator delete(void
*, void*, unsigned char const*)':
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
collect2: ld returned 1 exit status
make: *** [buildocci_static] Error 1



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


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