Re: Problem compiling Pro*C programs...

From: Jeffery Cann <jcann_at_fairway.com>
Date: Mon, 17 Aug 1998 08:46:38 -0600
Message-ID: <35D8424E.A0BA6FA_at_fairway.com>


For Oracle 7.3.3, I think it is much simpler (and by design of Oracle, based on their demo makefile) to just include the following file into your makefile:

# ----------------------------

# Pro*C libraries for Oracle 7
# ----------------------------

include $(ORACLE_HOME)/precomp/env_precomp.mk

Then, when you want to link, use the $(PROLDLIBS) macro, which is defined in the Oracle file. Make sure you pass the $(LIBHOME) macro with the -L flag before you reference the $(PROLDLIBS) macro. $(LIBHOME) is also defined in env_precomp.mk.

cc -o my_program -L$(LIBHOME) $(PROLDLIBS)

expands to (on a SCO OSR 5.0.4 system)

cc -o my_program -L/u/app/oracle/product/7.3.3/lib  -lxa -lsql -lsqlnet
-lncr -lsqlnet -lclient -lcommon -lgeneric -lsqlnet -lncr -lsqlnet
-lclient -lcommon -lgeneric  -lepc -lnlsrtl3 -lc3v6 -lcore3 -ln
lsrtl3 -lcore3 -lnlsrtl3     `cat

/u/app/oracle/product/7.3.3/rdbms/lib/sysliblist`

The advantage of using the macros defined by Oracle's file, rather than figuring out which Oracle libraries you are missing is that Oracle deals with it and encapsulates it into env_precomp.mk. Then, if they make changes to their libraries (not uncommon) you don't have to worry about it because they will update the env_precomp.mk file. Look at the demo make file in $(ORACLE_HOME)/precomp/demo/proc/proc.mk file for more info.

One last thing -- In the env_precomp.mk file, they define the $(CFLAGS) macro. If you are using this in your current makefile, you'll want to define it after you have included Oracle's env_precomp.mk file. Then you'll be sure that the correct compiler flags are used when you're invoking the compiler.

Hope this helps you.

Jeffery Cann

leungk_at_my-dejanews.com wrote:
>
> I am currently working on a project which involves migrations of several Pro*C
> programs from Oracle 7.0 (SunOS 4.1.1) to Oracle 7.3.3 (Solaris 2.5.1), in my
> makefile I have linked the library libora.a (-lora). The compilation works
> fine in the old environment, but an error occurs saying that the above library
> is not find in the new environment. I tried to take that flag off the
> makefile, but that creates a lot of undefined symbols errors referencing
> libsql.a and libsqlnet.a. Can anyone help me on this???
>
> which library can I call to replace the missing libora.a in 7.3.3?
>
> Thanks very much.
>
> Kenrick
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum

-- 
Jeffery Cann
Fairway Systems, Inc.
Senior Software Engineer
Received on Mon Aug 17 1998 - 16:46:38 CEST

Original text of this message