Template problem when linking with WorkShop 5

A

Avi Uziel

Hi All,

I have a linkage problem that I believe related to template instantiation.
My environment is Solaris 5.6, Compiler WorkShop 5.

I'm building a shared library which use templates. During a "good" linkage
(in other projects) the ld use the objects under the SunWS_cache which are
the template classes created by the compiler.
e.g. (two last lines)
/usr/ccs/bin/ld -dy -z defs -dy -G -L/p/sparcworks/SUNWspro/SC5.0/lib
-o <output dir>/libapi.so.1 /p/sparcworks/SUNWspro/SC5.0/lib/crti.o
<output dir>/SunWS_cache/CC_obj_U/UlUWxsTiEKbMlQ1CPUdS.o
<output dir>/SunWS_cache/CC_obj_5/5Obn06Np0jjwGIgxJPhq.o
....

In the link I'm running, I get an "Undefined Symbol" error about a template
object.
The link command don't use any objects under the template repository. I
would expect to see this objects in the link command!!!

Does any one have an idea?

Thanks,
Avi
 
V

Victor Bazarov

Avi Uziel said:
I have a linkage problem that I believe related to template instantiation.
My environment is Solaris 5.6, Compiler WorkShop 5.

I'm building a shared library which use templates. During a "good" linkage
(in other projects) the ld use the objects under the SunWS_cache which are
the template classes created by the compiler.
e.g. (two last lines)
/usr/ccs/bin/ld -dy -z defs -dy -G -L/p/sparcworks/SUNWspro/SC5.0/lib
-o <output dir>/libapi.so.1 /p/sparcworks/SUNWspro/SC5.0/lib/crti.o
<output dir>/SunWS_cache/CC_obj_U/UlUWxsTiEKbMlQ1CPUdS.o
<output dir>/SunWS_cache/CC_obj_5/5Obn06Np0jjwGIgxJPhq.o
...

In the link I'm running, I get an "Undefined Symbol" error about a template
object.
The link command don't use any objects under the template repository. I
would expect to see this objects in the link command!!!

Does any one have an idea?

(a) Linking is OS- and compiler-specific and as such is off-topic.

(b) If you think it even remotely can be due to an error in your code,
why not post your code so that we could confirm or dismiss your
apprehensions.

(c) Have you tried a newsgroup dedicated to the Sun's compiler? Or
perhaps they have a forum on their web site...

V
 
J

Jeff Schwab

Avi said:
Hi All,

I have a linkage problem that I believe related to template instantiation.
My environment is Solaris 5.6, Compiler WorkShop 5.

I'm building a shared library which use templates. During a "good" linkage
(in other projects) the ld use the objects under the SunWS_cache which are
the template classes created by the compiler.
e.g. (two last lines)
/usr/ccs/bin/ld -dy -z defs -dy -G -L/p/sparcworks/SUNWspro/SC5.0/lib
-o <output dir>/libapi.so.1 /p/sparcworks/SUNWspro/SC5.0/lib/crti.o
<output dir>/SunWS_cache/CC_obj_U/UlUWxsTiEKbMlQ1CPUdS.o
<output dir>/SunWS_cache/CC_obj_5/5Obn06Np0jjwGIgxJPhq.o
...

In the link I'm running, I get an "Undefined Symbol" error about a template
object.
The link command don't use any objects under the template repository. I
would expect to see this objects in the link command!!!

Does any one have an idea?

Off-topic (whip, whip).

It sounds like the cache is just out of sync. (This happens to me when
I move source files.) Blowing away the SunWS_cache ought to fix the
problem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,128
Latest member
ElwoodPhil
Top