Linking Oracle OCI libs and Sun C++

Linking Oracle OCI libs and Sun C++

Post by Olaf Schluet » Tue, 28 Feb 1995 21:14:05



Our application is mainly written in C++ and uses the OCI (Oracle C
Interface) for database access. Oracle delivers its own versions of
crt1.o, crt0.0 and crtn.o, the C runtime startup object files. The use
of OCI regarding linking is very poorly documented, but demo makefiles
suggest to use Oracle's runtime objects for your application.

However, we recently discovered, that initialization of global static C++
objects doesn't happen, if the application in question is built with
Oracle runtime startup objects. If we use the runtime startup code delivered
with Sun's C/C++ Compilers, the application is properly initialized and
does not show any obvious misbehaviour, not even in database access.

Nevertheless, we need some reassurement that we are allowed to omit
Oracle's runtime startup objects in linking.  Oracle Hotline keeps us
telling that C++ is not a supported development environment, and
refuses to state clearly whether using Oracle crt*.o files for linking
is necessary or not.

Is there any experience in NetWorld regarding this issue ? Especially,
did you run into trouble when linking your application without oracle
runtime objects ?

--
--

Medical Diagnostic Computing GmbH, Dppelstr. 71, 24105 Kiel, Germany,
Office Voice: 49-431-804220, Fax: 49-431-804230

 
 
 

Linking Oracle OCI libs and Sun C++

Post by Jeff Spir » Sat, 04 Mar 1995 10:08:53



> Our application is mainly written in C++ and uses the OCI (Oracle C
> Interface) for database access. Oracle delivers its own versions of
> crt1.o, crt0.0 and crtn.o, the C runtime startup object files. The use
> of OCI regarding linking is very poorly documented, but demo makefiles
> suggest to use Oracle's runtime objects for your application.

> However, we recently discovered, that initialization of global static C++
> objects doesn't happen, if the application in question is built with
> Oracle runtime startup objects. If we use the runtime startup code delivered
> with Sun's C/C++ Compilers, the application is properly initialized and
> does not show any obvious misbehaviour, not even in database access.

> Nevertheless, we need some reassurement that we are allowed to omit
> Oracle's runtime startup objects in linking.  Oracle Hotline keeps us
> telling that C++ is not a supported development environment, and
> refuses to state clearly whether using Oracle crt*.o files for linking
> is necessary or not.

> Is there any experience in NetWorld regarding this issue ? Especially,
> did you run into trouble when linking your application without oracle
> runtime objects ?

> --
> --

> Medical Diagnostic Computing GmbH, Dppelstr. 71, 24105 Kiel, Germany,
> Office Voice: 49-431-804220, Fax: 49-431-804230

The crt*.o files are nothing special for Oracle; they are just Sun's
normal C runtime.  Oracle supplies them so that customers can relink
with patches without having to buy the Sun compiler.  If you link
with the Sun C compiler (or the C++ compiler for that matter), you
need not use the Oracle crt*.o files.  So your application should
be fine.

Oracle will be officially supporting C++ with the 7.2 release, but
(unofficially) it should work now (of course, you need to supply
<extern "C"> declarations for the entry points).
not use