Operating System - Linux
1827776 Members
2497 Online
109969 Solutions
New Discussion

Error compiling pro*c thru make in HP-UX

 
SOLVED
Go to solution
hpuserhk
Frequent Advisor

Error compiling pro*c thru make in HP-UX

Hello friends,
i am compling pro*c in HP-UX with oracle
backend getting following errors,pl help:

Pro*C/C++: Release 9.2.0.4.0 - Production on Tue Apr 3 10:48:45 2007

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

System default option values taken from: /opt/oracle/product/ora92/precomp/admin
/pcscfg.cfg

: C compiler
/usr/ccs/bin/ld: Unsatisfied symbols:
xu_freeall (first referenced in tapin.o) (code)
xd_setp (first referenced in tapin.o) (code)
xu_perror (first referenced in tapin.o) (code)
asn1D_DataInterChange (first referenced in tapin.o) (code)
xcc@ : Compilation Error! ./tapin.c -o ./tapin.exe -I/opt/oracle/product/ora92/p
recomp/public -I/opt/oracle/product/ora92/rdbms/public -I/opt/oracle/product/ora
92/plsql/public -I/opt/oracle/product/ora92/network/public -L/opt/oracle/product
/ora92/lib32 -lclntsh -lnbeq9 -lnhost9 -lnus9 -lnldap9 -lldapclnt9 -lnsslb9 -lno
name9 -lntcp9 -lntcps9 -lnsslb9 -lntcp9 -lntns9 -l:libcl.sl -l:librt.sl -lpthrea
d -l:libnss_dns.1 -l:libdld.sl -lm -lpthread -lpthread -I../inc
*** Error exit code 1

Stop.
35 REPLIES 35
Dennis Handly
Acclaimed Contributor

Re: Error compiling pro*c thru make in HP-UX

Do you know where those unsats are defined?

You do seem to have your object before all of your libs, so -Wl,+n probably wouldn't work.
hpuserhk
Frequent Advisor

Re: Error compiling pro*c thru make in HP-UX

Hello Dennis,

Thanks for ur prompt reply

please let me know how i can compile in this
circumstance, i am using make file
can you gime sample make file for this compilation ,my make file just have information abt main header file used by my programm and abt .pc/.c/.o file, it do not
have any info abt other lib etc
Dennis Handly
Acclaimed Contributor
Solution

Re: Error compiling pro*c thru make in HP-UX

>please let me know how I can compile in this circumstance,

Not really. I have no idea whether these symbols are yours or are part of Pro*C??
xu_freeall (tapin.o)(code)
xd_setp
xu_perror
asn1D_DataInterChange

If these are yours, you need to define them. If not, perhaps you forgot a lib at the end of your list?

If you want to search libs, you can do:
$ nm -pxNA path/lib* | fgrep -e xu_freeall -e xd_setp -e xu_perror

And in this case, look for the definitions with "T".

hpuserhk
Frequent Advisor

Re: Error compiling pro*c thru make in HP-UX

when i run:
nm -pxNA path/lib* | fgrep -e xu_freeall -e xd_setp
i get this error:
nm: path/lib*: cannot open


I want to give some more info:
i am including one header file in my
main.pc file which is calling
(unsatis)xu_freeall etc as extern
hpuserhk
Frequent Advisor

Re: Error compiling pro*c thru make in HP-UX

when i run following commnad with path(as my curr dir)
nm -pxNA path/lib* | fgrep -e xu_freeall

I get following out put:

libasn1ber.a:0x00003a14 T xu_freeall
Dennis Handly
Acclaimed Contributor

Re: Error compiling pro*c thru make in HP-UX

>i get this error: nm: path/lib*: cannot open

Oops, you were suppose to replace "path" by the path to the libs you want to search.

>I get following output:
libasn1ber.a:0x00003a14 T xu_freeall

Good, you need to add -lasn1ber to your makefile. I assume there is a -L path that matches where you found it?

You should check to make sure the other 3 are there too.
hpuserhk
Frequent Advisor

Re: Error compiling pro*c thru make in HP-UX

Thanx for ur help
all 3 unstats there
i tried adding this file ,-lasn1ber to my make file,but still errors
can you give me exact syntax how i can add it
Dennis Handly
Acclaimed Contributor

Re: Error compiling pro*c thru make in HP-UX

>I tried adding this file, -lasn1ber to my makefile

Everybody's makefiles are different.
Did you get the same errors?

There should be some make macro with "LIB" in it. You just add: -lasn1ber

This macro would have to be used in the rule that builds tapin.exe.

hpuserhk
Frequent Advisor

Re: Error compiling pro*c thru make in HP-UX

Yes i get same error
Actually i created new make file for running this programm,is there any way i link required file (libasn1ber.a) with programm for resolving error
Dennis Handly
Acclaimed Contributor

Re: Error compiling pro*c thru make in HP-UX

>is there any way I link required file (libasn1ber.a) with program for resolving error

As I said, you need to add this lib to an existing *LIB* make macro, or add this lib to the build rule that links tapin.exe.

I suppose I can look at your makefile if is isn't too complex.

hpuserhk
Frequent Advisor

Re: Error compiling pro*c thru make in HP-UX

unsat function prototype in find in the called header file
My makefile is very simple as below please see:
.SUFFIXES: .pc .c .o

DEBUG_FLAG =

HDRS=tap.h asn1type.h
HDRS1=libasn1ber.a
EXE=tapin.exe
#include $(ORACLE_HOME)/precomp/lib/env_precomp.mk


all:tapin.pc
xpc tapin.pc -o ./$(EXE)

tapin.o:tapin.c $(HDRS) $(HDRS1) makefile
xcc tapin.c -c $(DEBUG_FLAG) $(HDRS1)

tapin.c:tapin.pc $(HDRS) $(HDRS1) makefile
xpc tapin.pc -c $(DEBUG_FLAG) $(HDRS1)



clean:
rm -f tapin.o tapin.c tapin.lis
Dennis Handly
Acclaimed Contributor

Re: Error compiling pro*c thru make in HP-UX

>My makefile is very simple as below please see:

Ok, trying to guess what it does:
all: tapin.pc
xpc tapin.pc -o ./$(EXE) -lasn1ber

You may want to look at env_precomp.mk to see if there is a variable you can set to add your lib.
hpuserhk
Frequent Advisor

Re: Error compiling pro*c thru make in HP-UX

As you can see in my make file
#include $(ORACLE_HOME)/precomp/lib/env_precomp.mk
is commented , and even if try to modify its read only

is there any other way i can link required library file libasn1ber.a

Thanks
Dennis Handly
Acclaimed Contributor

Re: Error compiling pro*c thru make in HP-UX

>As you can see in my makefile is commented

Oops, right.

>and even if try to modify its read only

That doesn't prevent you from define macros that are used in that makefile.

>is there any other way i can link required library file libasn1ber.a

As I said:
xpc tapin.pc -o ./$(EXE) -lasn1ber
hpuserhk
Frequent Advisor

Re: Error compiling pro*c thru make in HP-UX

Hello ,
after i modified: xpc tapin.pc -o ./$(EXE) -lasn1ber
I am getting this error




: C compiler
/usr/ccs/bin/ld: Can't find library: "asn1ber"
xcc@ : Compilation Error! ./tapin.c -o ./tapin.exe -lasn1ber -I/opt/oracle/produ
ct/ora92/precomp/public -I/opt/oracle/product/ora92/rdbms/public -I/opt/oracle/
Dennis Handly
Acclaimed Contributor

Re: Error compiling pro*c thru make in HP-UX

>ld: Can't find library: "asn1ber"

You'll need to add -L path-to-your-lib, before that -lasn1ber.
(That you found with that nm command.)
hpuserhk
Frequent Advisor

Re: Error compiling pro*c thru make in HP-UX

please give me exact syntax how to add path to lib ,and where to add
if had tried but not working
Dennis Handly
Acclaimed Contributor

Re: Error compiling pro*c thru make in HP-UX

>please give me exact syntax how to add path to lib and where to add

xpc tapin.pc -o ./$(EXE) -L absolute-path-to-libasn1ber -lasn1ber
hpuserhk
Frequent Advisor

Re: Error compiling pro*c thru make in HP-UX

Thanks for ur replies

Actually i tried by defining macros in the make file,it seems to work,but i think out of 3 unsatis ,it found 2,but still not finding 3rd(asn1D_DataInterChange)
i tried to find it by command
nm -pxNA /path/lib* | fgrep -e asn1D_DataInterChange
it dont gives any output.
how to search for this in all the directories or what is alternative in this situation please advice
Dennis Handly
Acclaimed Contributor

Re: Error compiling pro*c thru make in HP-UX

>but still not finding asn1D_DataInterChange

You need to go to Pro*C and see if they know what it is for.

Also do you have any variables with the name or substrings asn1D or DataInterChange in your tapin.pc?

>how to search for this in all the directories

You could use:
$ find paths-to-search -name "lib*" -exec nm -pxNA + 2> /dev/null | fgrep -e asn1D_DataInterChange

You could of course try making tapin.exe executable and execute it.
hpuserhk
Frequent Advisor

Re: Error compiling pro*c thru make in HP-UX

It is creating executable,but this one compilation error of unsat not found asn1D_DataInterChange,( and this function is used in the programm for decoding binary data),i am also able to run executable ,will it be ok ,if i use this exe ,i will check if this function is effecting functionality much if i comment where it is called
Dennis Handly
Acclaimed Contributor

Re: Error compiling pro*c thru make in HP-UX

>asn1D_DataInterChange, (and this function is used in the program for decoding binary data)

Are you calling it, or did Pro*C add it?

>will it be ok, if i use this exe

It will abort if asn1D_DataInterChange is called.
hpuserhk
Frequent Advisor

Re: Error compiling pro*c thru make in HP-UX

I am calling it,its proto defined in
the header file used by the program
hpuserhk
Frequent Advisor

Re: Error compiling pro*c thru make in HP-UX

$ find paths-to-search -name "lib*" -exec nm -pxNA + 2> /dev/null | fgrep -e asn1D_DataInterChange

giving no output