I am getting unresolved symbol error at runtime (733 Views)
Reply
Advisor
Rajakumar Kasi
Posts: 13
Registered: ‎05-05-2009
Message 1 of 18 (733 Views)
Accepted Solution

I am getting unresolved symbol error at runtime

Hi Experts,
I am getting below unresolved symbol error at runtime
/usr/lib/dld.sl: Unresolved symbol: __ct__13Iostream_initFv_1 (code) from /apps/myapps/bin/libxalan-c.sl.110

/usr/lib/dld.sl: Unresolved symbol: __ct__13Iostream_initFv_1 (code) from /apps/myapps/bin/libxalan-c.sl.110

Could you please help me to resolve the above run time issue?

Thanks and Regards,
Rajakumar K.
Acclaimed Contributor
Dennis Handly
Posts: 25,298
Registered: ‎03-06-2006
Message 2 of 18 (733 Views)

Re: I am getting unresolved symbol error at runtime

These are aC++ -AP iostream unsats. You should have -lstream on your link line.

What language is your executable?
You can't mix -AP and -AA or g++.
Advisor
Rajakumar Kasi
Posts: 13
Registered: ‎05-05-2009
Message 3 of 18 (733 Views)

Re: I am getting unresolved symbol error at runtime

Hi Dennis,
I am using GNU make and below HPUX C++ (aCC) compiler
PHSS_28880 1.0 HP aC++ -AA runtime libraries (aCC A.03.50)

I put -lstream in the linker command and still I am getting "/usr/lib/dld.sl: Unresolved symbol: quiet_NaN__14numeric_limitsXTd_SFv (code) from /data/CCPE/x_kasir/tce07/bin/libxalan-c.sl.110" error at run time.

Do you feel above error is a linker/compile problem?

I am not so good in HPUX builds.
Could you please let me know what is -AP, -AA and g++? Are these linker options?

Thanks and Regards,
Rajakumar K
Advisor
Rajakumar Kasi
Posts: 13
Registered: ‎05-05-2009
Message 4 of 18 (733 Views)

Re: I am getting unresolved symbol error at runtime

Hi Dennis,
Do you know which library contains the symbol "numeric_limits"?

Thanks and Regards,
Rajakumar K
Advisor
Kannan M Jeganathan
Posts: 16
Registered: ‎05-11-2009
Message 5 of 18 (733 Views)

Re: I am getting unresolved symbol error at runtime


> I put -lstream in the linker command and still I am getting "/usr/lib/dld.sl
> : Unresolved symbol: quiet_NaN__14numeric_limitsXTd_SFv (code)
> from /data/CCPE/x_kasir/tce07/bin/libxalan-c.sl.110" error at run time.

Use -lstd. Better is to recompile (rebuild) you application with -AP or whichever is appropriate.

> Do you feel above error is a linker/compile problem?

As the error says the symbol quiet_NaN__14numeric_limitsXTd_SFv is not resolved in your application. It is not a linker/compiler problem. It is most probably due to missing -l.

> Could you please let me know what is -AP, -AA and g++?
> Are these linker options?

These are compiler options. You could do "man aCC" and get the information about these options. Also in www.hp.com/go/aCC.

-AP: Turns off -AA mode. Uses the older C++ runtime libraries. This is the default.

-AA: Turns on newly supported ANSI C++ Standard features .... Objects and libraries compiled with -AA are binary incompatible with objects and libraries compiled without -AA.

g++: Actually it is -Ag++. It enables partial support for the GNU C++ dialect. It is supported only from A.03.80 onwards with +hpxstd98 option.

You could use c++filt to get a readable form of quiet_NaN__14numeric_limitsXTd_SFv.
quiet_NaN__14numeric_limitsXTd_SFv ==> static numeric_limits::quiet_NaN()
Advisor
Kannan M Jeganathan
Posts: 16
Registered: ‎05-11-2009
Message 6 of 18 (733 Views)

Re: I am getting unresolved symbol error at runtime

> Do you know which library contains the symbol "numeric_limits"?
libstd
Acclaimed Contributor
Dennis Handly
Posts: 25,298
Registered: ‎03-06-2006
Message 7 of 18 (733 Views)

Re: I am getting unresolved symbol error at runtime

>PHSS_28880 HP aC++ -AA runtime libraries (aCC A.03.50)

This is very old, you can update to an newer one, PHSS_33945.

>Could you please let me know what is -AP, -AA and g++? Are these linker options?

The first two are aC++ options, g++ is the Gnu C++ compiler. How are you building your application? Is it C and you are calling a aC++ shlib?

>Do you know which library contains the symbol "numeric_limits"?

Naturally. :-) If you are compiling and linking with aCC, this is automatically supplied. I would recommend this.

Otherwise, you should look at the following if you are mixing languages:
http://docs.hp.com/en/14672/Help/distributing.htm#apps

>Kannan: g++: Actually it is -Ag++.

No, g++ is g++, the foreign devil compiler. ;-)
Advisor
Rajakumar Kasi
Posts: 13
Registered: ‎05-05-2009
Message 8 of 18 (733 Views)

Re: I am getting unresolved symbol error at runtime

Hi Dennis,
>How are you building your application? Is it C and you are calling a aC++ shlib?
I am building my application with aCC compiler (PHSS_28880 1.0 HP aC++ -AA runtime libraries (aCC A.03.50))
Here may I know what is "aC++ shlib", is it aCC?

The library which contains the numeric_limits symbol is not automatically getting resolved at run time with libxalan-c.sl.110 and ldd also not showing that. so looks like I need to pass the library which contains numeric_limits symbol to the libxalan-c.sl.110 linker command. But you are telling it is automatically supplied while using aCC. So I could not understand this point.

Please clarify.

Thanks and Regards,
Rajakumar K

Advisor
Rajakumar Kasi
Posts: 13
Registered: ‎05-05-2009
Message 9 of 18 (733 Views)

Re: I am getting unresolved symbol error at runtime

Hi Dennis,
Please provide your answers based on aCC compiler that is specific to PHSS_28880 1.0 HP aC++ -AA runtime libraries (aCC A.03.50) version if possible.
Because I cannot use any other compiler for this particular build.

libxalan-c.sl.110 is linked with aCC compiler and I also using C compiler while building.


Thanks and Regards,
Rajakumar K
Advisor
Rajakumar Kasi
Posts: 13
Registered: ‎05-05-2009
Message 10 of 18 (733 Views)

Re: I am getting unresolved symbol error at runtime

Hi Dennis,
Are aC++ and aCC compilers same or different?

Thanks and Regards,
Rajakumar K
Advisor
Kannan M Jeganathan
Posts: 16
Registered: ‎05-11-2009
Message 11 of 18 (733 Views)

Re: I am getting unresolved symbol error at runtime

> Are aC++ and aCC compilers same or different?
aCC - HP aC++ compiler
cc, c89, c99 - HP C compiler
Acclaimed Contributor
Dennis Handly
Posts: 25,298
Registered: ‎03-06-2006
Message 12 of 18 (733 Views)

Re: I am getting unresolved symbol error at runtime

>I am building my application with aCC compiler

What version? What options? The default is -AP for PA. Who is the consumer of your shlib?

>may I know what is "aC++ shlib"

An aC++ shlibs is one built with the aC++ compiler. And not C, cfront, gcc nor g++.

>But you are telling it is automatically supplied while using aCC.

It is automatically supplied when creating executables. If you are creating a shlib, you would have to follow the directions on the above URL.

>Please provide your answers based on aCC compiler that is specific to PHSS_28880

I can't. That is a runtime patch, what compiler version are you using? (aCC -V)

> libxalan-c.sl.110 is linked with aCC compiler and I also using C compiler while building.

You need to look at the above URL when mixing languages.

>Are aC++ and aCC compilers same or different?

As Kannan said, aC++ is the name of the product and the driver is aCC(1).
Advisor
Rajakumar Kasi
Posts: 13
Registered: ‎05-05-2009
Message 13 of 18 (733 Views)

Re: I am getting unresolved symbol error at runtime

Thanks a lot Dennis and Kannan for your inputs.

Hi Dennis,
>What version? What options? The default is -AP for PA. Who is the consumer of your shlib?
aCC: HP ANSI C++ B3910B A.03.52

I am not using any of the -AP or -AA or g++ options during build.
I chekced for compiler/linker options for my aCC installation online document, but I could not find -AP option and I can find -AA option. Looks like "aCC: HP ANSI C++ B3910B A.03.52" is not supporting -AP option.
If -AP is not supported for "aCC: HP ANSI C++ B3910B A.03.52", then if -AA is not set, it means will it uses the older C++ runtime libraries and if -AA set, it means will it use newly supported ANSI C++ Standard library

Consumer of my shlib is another shared library(*.sl)

For your information uname -a output is
HP-UX pnhpr023 B.11.11 U 9000/800 3481275319 unlimited-user license

>what compiler version are you using? (aCC -V)
aCC: HP ANSI C++ B3910B A.03.52

One general question : If I use only aCC compiler (here I am not using any other compiler) for linking my shared libraries, should I put other shared libraries in the linker command who is having symbols that are refered in my shared library?

Do you know the path of the document for aCC which is equivalent to the document "HP-UX_Linker_and_Libraries_User's_Guide.pdf" as in the attachment.


Thanks and Regards,
Rajakumar K.
Advisor
Rajakumar Kasi
Posts: 13
Registered: ‎05-05-2009
Message 14 of 18 (733 Views)

Re: I am getting unresolved symbol error at runtime

Hi Dennis,
May I know from which aCC release, the -AP option available as I could not find -AP option in aCC: HP ANSI C++ B3910B A.03.52 version?

Thanks and Regards,
Rajakumar K
Acclaimed Contributor
Dennis Handly
Posts: 25,298
Registered: ‎03-06-2006
Message 15 of 18 (733 Views)

Re: I am getting unresolved symbol error at runtime

>I am not using any of the -AP or -AA or g++ options during build.

Then you are implicitly using the -AP default. (It wasn't until A.03.33 did we add an explicit option.)

>Consumer of my shlib is another shared library(*.sl)

Is that an aC++ shlib?
What language is the executable?

>should I put other shared libraries in the linker command who is having symbols that are referred in my shared library?

It depends. If only aC++ applications are going to use your shlib, there is no need to add the aC++ runtime shlibs to yours.
Or if these are your other dependent shlibs, you may want to add them, so you don't have to document that the end user must also link these extra shlibs.

>Do you know the path of the document for aCC which is equivalent to the document HP-UX_Linker_and_Libraries_User's_Guide?

There is my URL above and in the same document, you can look at:
http://docs.hp.com/en/14672/Help/libs.htm

>May I know from which aCC release, the -AP option available?

A.03.33. The -AP option is the default. So if your old compiler doesn't recognize it, just leave it off. You can look at old Release Notes:
http://docs.hp.com/en/5992-4209/5992-4209.pdf
Advisor
Rajakumar Kasi
Posts: 13
Registered: ‎05-05-2009
Message 16 of 18 (733 Views)

Re: I am getting unresolved symbol error at runtime


Hi Dennis,
>Is that an aC++ shlib?
Yes, this shlib created by aCC compiler and it is called libp.sl
And libp.sl is used by libq.sl and libq.sl is created by cc compiler
And libq.sl is used by libr.sl and libr.sl is created by cc compiler

When an executalbe called exea loads libp.sl into memory, no problem is seen.

When When an executalbe called exeb loads libr.sl into memory, the problem that I reported initially is seen (i.e "/usr/lib/dld.sl: Unresolved symbol: quiet_NaN__14numeric_limitsXTd_SFv (code) from /data/CCPE/x_kasir/tce07/bin/libxalan-c.sl.110")
After linking libxalan-c.sl.110 with -lstd library, above unresolved symbol error is solved.

Above is one set of dependancy
Another set of dependancy is as below
And libp.sl is used by another library called libz.sl and libz.sl is created by cc compiler
When an executable exec loads libz.sl into memory, above unresolved problem is not seen. But both libz.sl and libr.sl linker options are same, but I could not understand what is the wrong with build, the only difference is that no of level of dependancy is different(i.e libr.sl->libq.sl->libp.sl->libxalan-c.sl.110 is one set and libz.sl->libp.sl->libxalan-c.sl.110 is another set)

Do you have any idea why -lstd is needed when loading libr.sl library?

>What language is the executable?
aCC language(PHSS_28880 1.0 HP aC++ -AA runtime libraries (aCC A.03.50))

C language (B3901BA-B.11.02.08-HP C/ANSI C Developer's Bundle for HP-UX 11.0 (S800))


Thanks and Regards,
Rajakumar K
Acclaimed Contributor
Dennis Handly
Posts: 25,298
Registered: ‎03-06-2006
Message 17 of 18 (733 Views)

Re: I am getting unresolved symbol error at runtime

>When an executable called exea loads libp.sl into memory, no problem is seen.

Then this must be a aC++ executable.

>When an executable called exeb loads libr.sl into memory, the problem that I reported initially

Then this must be a C executable.

>When an executable exec loads libz.sl into memory, above unresolved problem is not seen.

Then this must be an aC++ executable or you aren't really using the stuff in libp.sl.

>Do you have any idea why -lstd is needed when loading libr.sl library?

Because libp.sl needs it.

>aCC language ... C language

What is the driver you used to link these 3 executables? That determines what language it is.

Note: It is not important why some of your cases works or not. If you don't follow the directions on mixing languages, it won't always work.
Advisor
Rajakumar Kasi
Posts: 13
Registered: ‎05-05-2009
Message 18 of 18 (733 Views)

Re: I am getting unresolved symbol error at runtime

Thanks a lot Dennis Handly and Kannan M Jeganathan.

Your invaluable inputs helped me to resolve my problem.

Regards,
Rajakumar K.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.