views:

71

answers:

1

I am having some trouble getting a program to link on Windows with VC2008 SP1. I am explicitly specialising a template member function in a DLL, which appears correctly as an exported symbol in dependency walker, for the correct type, and with the correct arguments.

When I try to call the symbol from an .exe, the linker complains that it can't resolve the symbol (although it compiles the object ok), however the decorated name of the symbol it says that it can't resolve exactly matches the decorated name of the exported symbol in my DLL (as viewed with dependency walker) The problem only occurs for explicitly specialised exported template member functions. If I comment the calls to these, all other exported functions classes will link ok, so the .lib looks like it is being generated ok.

I have tried changing my declaration of the template function in the headers to include the 'extern' directive, and it has the customary __declspec(dllimport) correctly specified, but this makes no difference.

Any ideas appreciated. Thanks.

+5  A: 

Finally managed to get to the bottom of this - it was caused by a .lib that didn't get checked-in to match the DLL from source control - maybe built with a different compiler version. Sorry for any wasted time. ... if all else fails, try rebuilding your library dependencies.

kdmiller
You know, I slept on it, and when I got up this morning that sort of thing was the conclusion I was left with. lol! Thanks for letting us know.
Troubadour