您的位置:首页 > 移动开发

CORBA Programming with TAO - 3.IDL Data Type(数据类型与Mapping)例子常见问题篇

2007-05-22 17:23 561 查看
(1) error LNK2001: unresolved external symbol "__declspec(dllimport) int __cdecl ace_os_main_i(class ACE_Main_Base &,int,char * * const)" (__imp_?ace_os_main_i@@YAHAAVACE_Main_Base@@HQAPAD@Z)
解决方法:Project->Settings->Link->Input->Object/library modules:
需要添加TAO的静态链接库文件:aced.lib

(2)error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall CORBA::String_var::~String_var(void)" (__imp_??1String_var@CORBA@@QAE@XZ)
解决方法:Project->Settings->Link->Input->Object/library modules:
需要添加TAO的静态链接库文件:taod.lib

(3)error LNK2001: unresolved external symbol "int __cdecl ace_main_i(int,char * * const)" (?ace_main_i@@YAHHQAPAD@Z)
解决方法:Project->Settings->Link->Input->Object/library modules:
需要添加TAO的静态链接库文件:TAO_AnyTypeCoded.lib

(4)fatal error C1083: Cannot open include file: 'tao/corba.h': No such file or directory
Error executing cl.exe.
这是因为路径设置还没有设置好:
在Tools->Options->Directories中, 分别添加如下目录:
Include files:
$(ACE_ROOT),$(TAO_ROOT),$(TAO_ROOT)/orbsvcs
Library files:
$(ACE_ROOT)/ace,$(TAO_ROOT)/tao,$(TAO_ROOT)/orbsvcs/orbsvcs

(5)error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall CORBA::Any::~Any(void)" (__imp_??1Any@CORBA@@QAE@XZ)
这是因为在Ace中main是进行了宏替换的。它必须加上入口参数。
int main(int argc, char **argv)

(6)fatal error C1189: #error : You must link against multi-threaded libraries when using ACE (check your project settings)
Error executing cl.exe.
这是因为工程设置没有设置好:
Project->Settings->C/C++->Code generation:
如果工程是Debug版, 选择Debug Multithreaded DLL
如果工程是Release版, 选择Multithreaded DLL

[align=left](7)error LNK2001: unresolved external symbol "public: virtual int __thiscall TAO_Perfect_Hash_OpTable::find(char const *,void (__cdecl*&)(class TAO_Abstract_ServantBase *,class TAO::Argument * *,int),enum TAO::Collocation_Strategy,unsigned
int)" (?find@TAO_Perfect_Hash_OpTable@@UAEHPBDAAP6AXPAVTAO_Abstract_ServantBase@@PAPAVArgument@TAO@@H@ZW4Collocation_Strategy@4@I@Z)
error LNK2001: unresolved external symbol "public: virtual class PortableServer::POA * __thiscall TAO_ServantBase::_default_POA(void)" (?_default_POA@TAO_ServantBase@@UAEPAVPOA@PortableServer@@XZ)
解决方法:Project->Settings->Link->Input->Object/library modules:
需要添加TAO的静态链接库文件:TAO_PortableServerd.lib[/align]
[align=left] [/align]
[align=left](8)warning C4541: 'dynamic_cast' used on polymorphic type 'class TAO::Any_Impl' with /GR-; unpredictable behavior may result
f:/test/idl/echoc.cpp(390) : while compiling class-template member function 'unsigned char __cdecl TAO::Any_Impl_T<class Echo>::extract(const class CORBA::Any &,void (__cdecl *)(void *),class CORBA::TypeCode *,class Echo *& )'[/align]
[align=left] [/align]
[align=left] dynamic_cast需要打开RTTI(运行时类型标识),VC缺省情况是关闭的。将编译参数/GR-改为/GR+就好:[/align]
[align=left] Project->Settings->C/C++->C++Language:
选上Enable Runtime Type information[/align]
[align=left][/align]
[align=left](待续……)[/align]
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐