我正在尝试构建 ACE 和 TAO 环境,但出现了很多错误。
我安装 ACE 和 TAO 的过程是:
- 将文件(ACE+TAO+CIAO-6.1.2.zip)解压到文件夹(C:\ACE_wrappers)
- 在 C:\ACE_wrappers\ace 中创建一个 config.h 文件
- 打开 config.h 文件并输入以下行:
#definenter 代码here ACE_HAS_WINNT4 1
#define ACE_HAS_STANDARD_CPP_LIBRARY 1
#define ACE_HAS_MFC 1
#define THR_USE_AFX 1
#define ACE_USES_STATIC_MFC 1
#define ACE_AS_STATIC_LIBS 1
#define ACE_NO_INLINE
#include "ace/config-win32.h"
- 保存并关闭
- 打开控制面板->系统->高级系统设置->环境变量
- 新建系统变量:ACE_ROOT,值:C:\ACE_wrappers
- 新建系统变量:TAO_ROOT,值:C:\ACE_wrappers\TAO
在 PATH 系统变量中,添加值:C:\Program Files\Microsoft Visual Studio 10.0\VC\bin;C:\ACE_wrappers\bin;C:\ACE_wrappers\lib;C:\ACE_wrappers\TAO\bin; 所以值为:%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;c:\Program Files\Microsoft SQL Server\100\Tools\ Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;%USERPROFILE%.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files\Windows Kits\8.1 \Windows 性能工具包\;C:\Program Files\Microsoft Visual Studio 10.0\VC\bin;C:\ACE_wrappers\bin;C:\ACE_wrappers\lib;C:\ACE_wrappers\TAO\bin;
启动 Visual Stiduo 2010
- 在 C:\ACE_wrappers\TAO 中打开 TAO_ACE_vc10.sln 解决方案
- 在解决方案配置中选择发布(在菜单栏上)
- 选择所有项目并右键单击然后选择属性
- 设置配置属性 -> 常规 -> 使用 MFC 以在共享 DLL 中使用 MFC
- 在配置属性 -> VC++ 目录 -> 可执行目录中添加 C:\ACE_wrappers\bin;
- 在 Configuration Properties -> VC++ Directories -> Include Directories 添加 C:\ACE_wrappers C:\ACE_wrappers\TAO C:\ACE_wrappers\TAO\tao C:\ACE_wrappers\TAO\orbsvcs C:\ACE_wrappers\TAO\orbsvcs\orbsvcs
在配置属性 -> VC++ 目录 -> 库目录中添加 C:\ACE_wrappers\ace C:\ACE_wrappers\TAO\tao C:\ACE_wrappers\TAO\orbsvcs\orbsvcs
选中每个项目,检查其配置属性->常规->配置类型是否为动态库(.dll),如果是,则更改为静态库(.lib),如果是Application(.exe)或Utility,则我不改变。就像在构建过程中出现错误的 Scheduling_Service 项目一样。
- 构建 -> 构建解决方案
时间长了,大部分项目都建成功了。Scheduling_Service、Time_Service_Clerk、NT_Notify_Service、Naming_Service(可能还有其他几个项目)有错误(错误 LNK2001: unresolved external symbol "__declspec(dllimport) public:......)。
1>Scheduling_Service.obj:错误 LNK2019:无法解析的外部符号“__declspec(dllimport) public: __thiscall TAO_ORB_Manager::~TAO_ORB_Manager(void)”(__imp_??1TAO_ORB_Manager@@QAE@XZ) 在函数 __unwindfunclet$??0TAO_Scheduling_Service@@ 中引用QAE@XZ$0 1>Scheduling_Service.obj : 错误 LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: __thiscall TAO_ORB_Manager::TAO_ORB_Manager(class CORBA::ORB *,class PortableServer::POA *,class PortableServer::POAManager *) " (__imp_??0TAO_ORB_Manager@@QAE@PAVORB@CORBA@@PAVPOA@PortableServer@@PAVPOAManager@4@@Z) 在函数 "public: __thiscall TAO_Scheduling_Service::TAO_Scheduling_Service(void)" (??0TAO_Scheduling_Service@@QAE@ XZ) 1>Scheduling_Service.obj : 错误 LNK2019: 无法解析的外部符号 "__declspec(dllimport) public:virtual __thiscall CosNaming::Name::~Name(void)" (__imp_??1Name@CosNaming@@UAE@XZ) 在函数 "public: int __thiscall TAO_Scheduling_Service::init(int,char * * const)" (? init@TAO_Scheduling_Service@@QAEHHQAPAD@Z) 1>TAO_RTSchedd.lib(Scheduler_Factory.obj) : 错误 LNK2001: 无法解析的外部符号 "__declspec(dllimport) public: virtual __thiscall CosNaming::Name::~Name(void)" (__imp_? ?1Name@CosNaming@@UAE@XZ) 1>Scheduling_Service.obj : 错误 LNK2019: 无法解析的外部符号“__declspec(dllimport) public: struct CosNaming::NameComponent & __thiscall TAO::unbounded_value_sequence::operator[](unsigned int)” (__imp_??A?$unbounded_value_sequence@UNameComponent@CosNaming@@@TAO@@QAEAAUNameComponent@CosNaming@@I@Z) 在函数“public: int __thiscall TAO_Scheduling_Service::init(int,char * * const)" (?init@TAO_Scheduling_Service@@QAEHHQAPAD@Z) 1>TAO_RTSchedd.lib(Scheduler_Factory.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: struct CosNaming::NameComponent & __thiscall TAO::unbounded_value_sequence::operator[](unsigned int)" (__imp_??A?$unbounded_value_sequence@UNameComponent@CosNaming@@@TAO@@QAEAAUNameComponent@CosNaming@@I@Z)
有谁知道这个问题?非常感谢。