如果在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文件中使用sequence<string>类型,并将其编译为DLL时遇到的编译错误问题。该错误源于TAO::unbounded_basic_string_sequence<charT>的不一致显式实例化。文章给出了一个简单的解决方案:在IDL文件开头引入tao/StringSeq.pidl。
1434

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



