c++visual-studio-2010corbaacetao

Many errors happened when building ACE and TAO (CORBA) using VS 2010


I'm trying to build ACE and TAO environment but got many errors.

The procedure what I did to install ACE and TAO is:

  1. Unzip the file (ACE+TAO+CIAO-6.1.2.zip) into the folder (C:\ACE_wrappers)
  2. Create a config.h file in C:\ACE_wrappers\ace
  3. Open the config.h file and type in lines:

#definenter code heree 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"

  1. Saved it and close
  2. Open Control Panel - > System -> Advanced system settings -> Environment Variables
  3. Create a new system variable: ACE_ROOT, value: C:\ACE_wrappers
  4. Create a new system variable: TAO_ROOT, value: C:\ACE_wrappers\TAO
  5. In PATH system variable, add value: C:\Program Files\Microsoft Visual Studio 10.0\VC\bin;C:\ACE_wrappers\bin;C:\ACE_wrappers\lib;C:\ACE_wrappers\TAO\bin; so the value is: %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 Performance Toolkit\;C:\Program Files\Microsoft Visual Studio 10.0\VC\bin;C:\ACE_wrappers\bin;C:\ACE_wrappers\lib;C:\ACE_wrappers\TAO\bin;

  6. Start Visual Stiduo 2010

  7. Open TAO_ACE_vc10.sln solution in C:\ACE_wrappers\TAO
  8. Select Release in solution configuration (on the menu bar)
  9. Select all project and right-click then choose Properties
  10. Set Configuration Properties -> General -> Use of MFC to Use MFC in a Shared DLL
  11. In Configuration Properties -> VC++ Directories -> Executable Directories add C:\ACE_wrappers\bin;
  12. In Configuration Properties -> VC++ Directories -> Include Directories add C:\ACE_wrappers C:\ACE_wrappers\TAO C:\ACE_wrappers\TAO\tao C:\ACE_wrappers\TAO\orbsvcs C:\ACE_wrappers\TAO\orbsvcs\orbsvcs
  13. In Configuration Properties -> VC++ Directories -> Library Directories add C:\ACE_wrappers\ace C:\ACE_wrappers\TAO\tao C:\ACE_wrappers\TAO\orbsvcs\orbsvcs

  14. Select every project and check whether its Configuration Properties -> General -> Configuration Type is Dynamic Library (.dll), if it is, then change to Static library (.lib) But if it is Application(.exe) or Utility, then I do not change. Like the Scheduling_Service project which has error during build.

  15. Build -> Build Solution

After a long time, most projects are built successfully. The Scheduling_Service, Time_Service_Clerk, NT_Notify_Service, Naming_Service (, and maybe there are few other projects) have errors (error LNK2001: unresolved external symbol "__declspec(dllimport) public:......).

1>Scheduling_Service.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall TAO_ORB_Manager::~TAO_ORB_Manager(void)" (__imp_??1TAO_ORB_Manager@@QAE@XZ) referenced in function __unwindfunclet$??0TAO_Scheduling_Service@@QAE@XZ$0 1>Scheduling_Service.obj : error LNK2019: unresolved external symbol "__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) referenced in function "public: __thiscall TAO_Scheduling_Service::TAO_Scheduling_Service(void)" (??0TAO_Scheduling_Service@@QAE@XZ) 1>Scheduling_Service.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall CosNaming::Name::~Name(void)" (__imp_??1Name@CosNaming@@UAE@XZ) referenced in function "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: virtual __thiscall CosNaming::Name::~Name(void)" (__imp_??1Name@CosNaming@@UAE@XZ) 1>Scheduling_Service.obj : error LNK2019: 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) referenced in function "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)

Does anyone know this problem? Thank you very much.


Solution

  • You shouldn't use #define ACE_AS_STATIC_LIBS 1 unless you are using a Visual Studio project which are generated for static usage. At the moment you want to do a static build you have to regenerate the Visual Studio projects with MPC