Operating System - HP-UX
1827889 Members
1631 Online
109969 Solutions
New Discussion

Re: aCC++ compilation error while using ld

 
sujeet joshi
Frequent Advisor

aCC++ compilation error while using ld

Hi All,

I am facing problem in hpux 11iv2 version with aCC++ while compiling. I able to create exe file but not able to link that file with sybase DB . When I used cc -ld it gives me a fatal error..

Please help me in this issue....

Thanks
Sujeet
9 REPLIES 9
Yogesh M Puranik
Valued Contributor

Re: aCC++ compilation error while using ld

Hi,

I believe, its because of C++ compiler need to be installed .


Rgd
YMP
Steven Schweda
Honored Contributor

Re: aCC++ compilation error while using ld

> I able to create exe file but not able to
> link that file with sybase DB .

I don't understand this.

> When I used cc -ld it gives me a fatal
> error..

Do you think that it might be useful to show
the actual command you used and its actual
output? I do.

"cc -ld" looks to me like the essence of a
defective command, but without seeing the
whole thing, it's hard to be sure.

"man cc", look for "-l" (and/or "-L"). Then,
if you don't see what you're doing wrong, try
including some useful information with your
next posting.
sujeet joshi
Frequent Advisor

Re: aCC++ compilation error while using ld

Hi,

Thanks for reply,

Here is the o/p swlist -l product | grep -i compiler
ACXX C.06.20 HP C/aC++ Compiler
C-ANSI-C C.06.20 HP C/aC++ Compiler
COMPLIBS B.11.23 Compiler Support Librarys
PHCO_34697 1.0 Japanese linker/compiler/unwind manpages
PHCO_39136 1.0 Linker/compiler/unwind ENG manpage patch
PHSS_34420 1.0 bundled PA C compiler on IPF
# /opt/aCC/bin/aCC -V
aCC: HP C/aC++ B3910B A.06.20 [May 13 2008]

this is the version i have installed .

when i issued this below command the o/p is----

# cc -ltcl
ld: Can't find library for -ltcl
Fatal error.

library files like -ltcl -linsck -lintl -lcs -lct -lcomn -lsrv -lsybdb -lm -lcurses not working with cc


Thanks once again
Steven Schweda
Honored Contributor

Re: aCC++ compilation error while using ld

> # cc -ltcl
> ld: Can't find library for -ltcl
> Fatal error.

So, where is libtcl.a (or libtcl.*)?

> "man cc", look for "-l" (and/or "-L").

Definitely look for "-L".

> library files like -ltcl -linsck -lintl
> -lcs -lct -lcomn -lsrv -lsybdb -lm -lcurses
> not working with cc

And where are those libraries? cc and ld are
not psychic. If libraries are not in the
default location, then you need to tell cc/ld
where to look for them.
sujeet joshi
Frequent Advisor

Re: aCC++ compilation error while using ld

Hi,

I want to confirm that whether the development kit I have installed is proper or not for Itanium system with hpux 11i v2 version.....

Next is if I run same command on hpux 11i v1 it works and no error but i am not able to find lbctl.a file in v2

Thanks
sujeet joshi
Frequent Advisor

Re: aCC++ compilation error while using ld

Hi

libctl.a not found ......
Steven Schweda
Honored Contributor

Re: aCC++ compilation error while using ld

> [...] but i am not able to find lbctl.a
> file in v2

Where did you look? How did you look? As
usual, showing actual commands and their
actual output can be more helpful than vague
descriptions and interpretations.

> libctl.a not found ......

Who was looking?

Are you looking for "lbctl", "libctl", or
"libtcl"?

> Next is if I run same command on hpux 11i
> v1 it works

So, where are these libraries on _that_
system?

Did you get as far as "man ld"? Did you see
the part about LDPATH? What does
echo $LDPATH
say on the two systems?
Dennis Handly
Acclaimed Contributor

Re: aCC++ compilation error while using ld

I see no compilation errors, just your linker error.
Note: The latest aC++ compiler is A.06.23, PHSS_39823.

># cc -ltcl
>ld: Can't find library for -ltcl
>library files like -ltcl -linsck -lintl -lcs -lct -lcomn -lsrv -lsybdb -lm -lcurses not working with cc

As Steven says, you need a -L path that includes these libs.

>if I run same command on 11i v1 it works

Where are these on 11.11? (Use -Wl,-t) Did you forget to install them on your 11.23 machine?

>Steven: Did you see the part about LDPATH?

(I see no LDPATH.) It isn't recommended to use LPATH since the driver also uses that to communicate various options to ld. Instead use "-L path" for each.
Steven Schweda
Honored Contributor

Re: aCC++ compilation error while using ld

> (I see no LDPATH.)

Oops. My brain must be stuck on
LD_LIBRARY_PATH.

> It isn't recommended to use LPATH [...]

I wouldn't use it, either, but if one is
trying to explain why a link works on one
system but fails on another, then it's a
reasonable thing to check.