tags:

views:

191

answers:

2
+2  Q: 

Linker problem

+1  A: 

can you nm the object which is generated by above shown code, to see that the signature is indeed what you expect.

Vardhan Varma
In all honesty there's so many things generated by nm I'm currently very confused. The function is present in libmiindsparseimplementation.so though, which is correct afaik?
Ed Woodcock
use nm -A -C | grep T
Vardhan Varma
It may be a .lib order issue as someone else noted.just give all your libraries twice (-:or do the painful lorder+tsort magic.
Vardhan Varma
Ok, using nm I seem to not have the exact function it asked for, I'll update the question.
Ed Woodcock
A: 

Trying to parse (reformat) that line so I can read it...

libmiinddynamic.so: undefined reference to:
ostream & SparseImplementationLib::operator<<
   < double, double, SparseImplementationLib::DefaultPtr<double, double> >
(
   ostream &,
  SparseImplementationLib::AbstractSparseNode<
     double, double, SparseImplementationLib::DefaultPtr<double, double> > const
)

If I read that right, then:

  • class ActivityType is a double.
  • class WeightType is a double.
  • *class ptr_type* is a SparseImplementationLib::DefaultPtr<double, double>

And somehow the second argument
const AbstractSparseNode<ActivityType,WeightType>&,
e.g const AbstractSparseNode<double,double>&
has become a:

  SparseImplementationLib::AbstractSparseNode<
     double,
     double,
     SparseImplementationLib::DefaultPtr<double, double>
       > const &

The template argument counts don't match up. You've defined the second (templated) argument with 2 templated parameters and your error message indicates 3 templated parameters.

Mr.Ree
Oh, sorry. The AbstractSparseNode has a third defaulted template argument. (It defaults to . . . DefaultPtr<ActivityType,WeightType> =)
Ed Woodcock