来看几篇文章:
How can I avoid linker errors with my template functions?
Why can templates only be implemented in the header file?
就是说,C++11以后extern不再是关键字了,导出模板的定义必须写在头文件。
还有一种解决办法:
Function template instantation & export from DLL
C++ 导出函数模板
最新推荐文章于 2024-01-19 17:58:10 发布