Template problem when linking with WorkShop 5

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Avi Uziel

    Template problem when linking with WorkShop 5

    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/UlUWxsTiEKbMlQ1 CPUdS.o
    <output dir>/SunWS_cache/CC_obj_5/5Obn06Np0jjwGIg xJPhq.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







  • Victor Bazarov

    #2
    Re: Template problem when linking with WorkShop 5

    "Avi Uziel" <ouziel_a@hotma il.com> wrote...[color=blue]
    > 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/UlUWxsTiEKbMlQ1 CPUdS.o
    > <output dir>/SunWS_cache/CC_obj_5/5Obn06Np0jjwGIg xJPhq.o
    > ...
    >
    > In the link I'm running, I get an "Undefined Symbol" error about a[/color]
    template[color=blue]
    > 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?[/color]

    (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


    Comment

    • Jeff Schwab

      #3
      Re: Template problem when linking with WorkShop 5

      Avi Uziel wrote:[color=blue]
      > 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/UlUWxsTiEKbMlQ1 CPUdS.o
      > <output dir>/SunWS_cache/CC_obj_5/5Obn06Np0jjwGIg xJPhq.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?[/color]

      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.

      Comment

      Working...