Re: Pro*C newbie needs help linking
Date: 1997/05/22
Message-ID: <338aa789.5803655_at_newshost>#1/1
I always include the proc makefile found in
$ORACLE_HOME/proc/demo/proc.mk in 7.2 and before
$ORACLE_HOME/precomp/demo/proc/proc.mk in 7.3
So my makefile looks something like:
- proc.mk ---------------------------------
$(TARGET): $(SOURCE) $(SOURCE:.pc=.c) $(SOURCE:.pc=.o)
$(CC) $(LDFLAGS) -t -o $(TARGET) \ $(SOURCE:.pc=.o) $(PROLDLIBS)
include $(ORACLE_HOME)/precomp/demo/proc/proc.mk
PROCFLAGS= ireclen=255 lines=yes $(PROC_ENV_FLAGS) \
include=$(ORACLE_HOME)/proc/lib CFLAGS=-I. -g $(CC_ENV_FLAGS)
---------------- EOF --------------------------------
And I send in the TARGET (the name of the executable to build) and the list of .pc files to precompile and compile. I frequently use the following script:
- procmk ----------------------- SRC=`echo *.pc` TGT=`pwd | sed 's".*/""'`
echo SRC = $SRC
echo TGT = $TGT
echo Remember you can set PROC_ENV_FLAGS to pass things to ProC
echo Remember you can set CC_ENV_FLAGS to pass things to CC
make -f /export/home/tkyte/bin/proc.mk "SOURCE=$SRC" "TARGET=$TGT"
------------------ eof --------------------------------
Which assumes your in a directory full of .pc files, all of these .pc files make up your program, and the directory is named after the program you would like to have.....
Hope this helps. The list of libs is in $(PROLDLIBS) in 7.3 and $(PROCLDLIBS) in 7.2 and earlier...
On Tue, 20 May 1997 20:31:03 GMT, chuckh_at_dvol.com (Chuck Hamilton) wrote:
[Quoted] >I have a really simple test pro*c program that I'd like to compile and >link. The precompiler runs fine against it but when I try to compile >and link, I get an error that says... > >/usr/ccs/bin/ld: Unsatisfied symbols: > sqlcxt (code) > >The platform is hpux 10.20, Oracle 7.3.2, Pro*C 2.2.2.0 > >Can someone tell me what the command line I need to compile and link >would be. > >Thanks in advance. >-- >Chuck Hamilton >chuckh_at_dvol.com > >If at first you don't succeed, skydiving isn't for you.
Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Bethesda MD
http://govt.us.oracle.com/ -- downloadable utilities
Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Thu May 22 1997 - 00:00:00 CEST
