A: 

It sounds like you're not linking dynamiclib.so to the SparseImplementationLib correctly. Do you have a linker flag similar to -lSparseImplementationLib in your makefile?

Harper Shelby
SparseImplementationLib is another library that is compiled from code files, it's in another directory and called libmiindsparseimplementation.so, and afaik it's linking in fine.Cus this is CCMAKE I can't really mess with the make file, it goes insane if you do.
Ed Woodcock
+1  A: 

See this SO question Compiler not creating templated ostream << operator

epatel
Yeah, it's friend <>'d and the declaration and actual code are both in the same file as it's an abstract class.Still doesn't link. . .
Ed Woodcock
well, ostream should be defined as basic_ostream<char>...but I'd guess the "usage" (needed call) are with a cout, perhaps? cout should be defined as an ostream...MPICXX has it different? Are the you including iostream?
epatel
Yeah, I'm using IOstream, and basic_ostream is the same thing as ostream, I've tried overriding the method so it uses the basic one and it moans that it's already in there!
Ed Woodcock
A: 

I had (almost) the same issue with a gStreamer like engine I'm working on - a function called from a .so file did not exist in the main code.

I found that the function was being removed by the linker as it was not being called by any internal functions.

At the moment, I've worked around the problem by forcing the function to be included by the linker via a function call/constructor, within a function that is conditionally never called:-

bool callme = false;

if(callme == true)
{
    dummyfunction();
}

I found that this forced the linker to include, but the code itself was never run.

If anyone has a solution that either stops the linker being so intelligent, or there is a 'correct' method to use, I'd like to hear about it!

James Fisher
A: 

Ok, I managed to fix this this morning after about 10 hours hacking away last night.

Turns out that it compiles if you make the definitions of the function inline, and make sure it has options for the function with both all the template arguments and just non-defaulted arguments!

Ed Woodcock