在DLL编程中调用模版类时出现的类似"class“XXX”需要有 dll 接口由 class“XXX”的客户端使用"的warning的解决方案
2009-10-30 19:53
666 查看
在DLL编程中, 如果调用模版类, 则可能出现类似以下的错误(以CString的使用为例):
解决方法如下:
在调用该模板类之前, 先加入以下声明, 将模版类导出(export):
如此, 则可消除该warning.
参考: http://topic.csdn.net/u/20090321/09/bc66fb7d-14f1-4b57-b6a0-5d3c86907cb2.html
warning C4251: “CLogFile::m_strFileName”: class“ATL::CStringT <BaseType,StringTraits>”需要有 dll 接口由 class“CLogFile”的客户端使用
解决方法如下:
在调用该模板类之前, 先加入以下声明, 将模版类导出(export):
template class __declspec(dllexport) CStringT<char>;
如此, 则可消除该warning.
参考: http://topic.csdn.net/u/20090321/09/bc66fb7d-14f1-4b57-b6a0-5d3c86907cb2.html
相关文章推荐
- 在DLL编程中调用模版类时出现的类似"class“XXX”需要有 dll 接口由 class“XXX”的客户端使用"的warning的解决方案
- 在DLL编程中调用模版类时出现的类似"class“XXX”需要有 dll 接口由 class“XXX”的客户端使用"的warning的解决方案
- 告警“需要有 dll 接口由 class“xxx”的客户端使用”的解释
- ALT 工程中,当导出类中包含string类型的私有成员时,会产生告警 warning C4251:class“std::basic_string”需要有 dll 接口由 class“xxx”的客户端使用
- warning C4251: class ... 需要有 dll 接口由 class“XClock” 的客户端使用
- AXIS的"dotnet_soapenc_bugfix"属性会自动重设的bug,将导致c++客户端调用soap接口失败
- 【转】VC中的class“std::vector<_Ty>”需要有 dll 接口由 class“Test”的客户端使用错误
- warning C4251: “std::vector<_Ty>”需要有 dll 接口由 class“Test”的客户端使用错误
- spring使用aop时需要设置proxy-target-class="true" 否则无法依赖注入
- eclipse出现java.lang.ClassNotFoundException: Didn't find class "xxx" on path: DexP...解决方案
- 解决"java.lang.UnsatisfiedLinkError: Native Library xxx.dll already loaded in another classloader"问题
- Eclipse打包Android项目时用到proguard.cfg后,出现的Warning:can't find referenced class问题的解决方案
- "_OBJC_CLASS_$_AVAudioSession", referenced from:解决方案
- 使用SpringMVC注解@RequestParam(value="XXX",required=false)时需要注意的问题
- 搭建基于hadoop 2.2.0的分布式集群启动时出现 "Unable to load native-hadoop library for your platform" 的解决方案
- "需要 Oracle 客户端软件 8.1.7 或更高版本"解决办法
- 安装JDK出现"Windows Installer程序包有问题,此安装需要的DLL不能运行"解决方法
- 使用<input type="text" value=<%=str%>>出现取值不全的问题
- VB调用DLL导出函数出现"Bad DLL call convention"的解决
- win 7 删除了用户文件夹后出现的&quot;你已使用临时配置文件登录&quot;提示的解决方法