模板类 - 未解析的外部符号 [英] Template class - unresolved external symbol(s)

查看:103
本文介绍了模板类 - 未解析的外部符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到这个错误一个LOT,我从来不知道为什么。有人可以帮我找到原因吗?

I get this error a LOT, and i never know why. Can someone help me find the cause of it?

编辑:删除的代码

推荐答案

将实现(您的方法定义)与类声明一起放入标头中(请参阅这在C ++常见问题)。一些编译器支持一个导出关键字来做它的方式,但是已经在C ++ 0x中混合。

Put the implementation (your method definitions) into the header along with the class declaration (see this in the C++ FAQ). Some compilers have supported an "export" keyword for doing it the way that you did, but that has been nixed in the C++0x.

这篇关于模板类 - 未解析的外部符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆