I am using VS2008 in win7 and g++ 4.7 in CentOS 18. The issue is only seen on Windows when I used dynamically shared library. When I convert it static library the program li
I worked out the problem. Under windows class template and function template are exported differently and there is a interesting reading on the net.
VS compilers exports class template symbols if class template is instantiated on the translation unit (.cpp).
However, in the case of function template, the keyword '__declspec(dllexport)' needs to be present explicitly for the symbols to be present on the dynamic library.
e.g
template EXPORT void HelpingRegistration( double );
//EXPORT is defined as __declspec(dllexport)
It's just another case where VS decide to things differently. There is interesting reading here: http://www.codesynthesis.com/~boris/blog/2010/01/18/dll-export-cxx-templates/