如果在idl中直接使用sequence<string>,并把这个idl生成的代码编译成dll,编译时会产生如下的错误
ACE_wrappers\TAO\tao/StringSeqC.h(140) : error C2961: 'TAO::unbounded_basic_string_sequence<charT>' : inconsistent explicit instantiations, a previous explicit instantiation did not specify '__declspec(dllimport)'
1> with
1> [
1> charT=char
1> ]
解决办法
在idl的前面增加一行
#include "tao/StringSeq.pidl"
即可。
本文介绍了一个在IDL文件中使用String序列时遇到的编译错误,并提供了解决方案。错误出现在尝试将IDL生成的代码编译为DLL时,通过包含特定的头文件可以解决该问题。
1264

被折叠的 条评论
为什么被折叠?



