FAQ - Building a component using VC++ Project Workspace

Open a dos command console, change to <K2APP_Dir>\k2 and execute config.bat. (K2APP_DIR is the directory where you have installed K2 eg. C:\k2_ccm_server_1_1). This is to setup the necessary Environment for the current console window


Create a new empty project work space of type Win32 Dynamic Link Library. ( Let the project name be same as the component name).


Place your idl and cidl file in the project directory. (Assuming idl/cidl files are already created)


Run K2 IDL compiler to generate idl2 and its stubs and skeletons:

In the same command console where you run config.bat, go to the project directory where the idl/cidl files are available and execute the command

K2cidl <idlfilename> (The file which has the extension.idl)


Run K2 CIDL compiler to generate component executors and skeletons:

In the same command console, Type the command

K2cidl -impl-all --gen-desc <cidl file name> (The file with extension .cidl)

Note : If you already have the implementation created then donot use the flag -impl-all, because this flag generates the default implementation file (*_cimpl.cpp which is the default naming convention).


Add files *.cxx, *_skel.cxx, *_cimpl.cpp and *_cskel.cpp (these files would have generated from steps 4,5,and 6) to the Project Workspace. If your implementation file is named differently rather than *_cimpl.cpp and _cimpl.h, then add them to the project.


Go to settings from the project menu

Select C/C++ tab and add symbols

  1. __ACE_INLINE__, TAO_ORB in the preprocessor definitions edit box.
  2. Select MultiThreaded DLL from Code generation of category.
  3. Select RTTI option from C++ Language of category.
  4. Add <k2app_dir>\ACE_Wrappers, <k2app_dir>\ACE_Wrappers\TAO <k2app_dir>\k2\include , in Additional include directories edit box.

Select Link tab

  1. Add
    CCM2cpp.lib K2Utils.lib K2idl2cpp.lib K2CCMCif.lib ace.lib tao.lib
    TAO_PortableServer.lib TAO_TypeCodeFactory.lib TAO_IFR_Client.lib
    Also add K2CCMUtils.lib for entity components.

    To Object/Library modules edit box.
  2. Add
    <k2app_dir>\ACE_Wrappers\lib, <k2app_dir>\k2\lib, <k2app_dir>\ACE_Wrappers\bin
    To Additional libray path edit box.

Now select the Build menu and say ReBuild all to generate the component dll.

9. By default the dll will be created inside the Debug directory. Copy the *.dll and *.lib files to a new directory (referred to further as the PKG_DIR). Also, copy all DTDs from <k2app_dir>k2\idl, the generated .csd, .ccd, .k2d, along with the .idl2 file to PKG_DIR

To make an archive

  • Open a dos command window, change to PKG_DIR,
  • run the config.bat from <k2app_dir>\k2 to setup the necessary Environment for the current console window
  • run the packaging tool with the following command
    zippie -f <zipfilename> -a <dllfilename> <libfilename> *.k2d *.csd *.ccd *.dtd *.idl2
NOTE: All dtds are available in <k2app_dir>\k2\dtd directory
This archive can be deployed into the K2 Component Server.
K2 Assembly Tool
Financial Component
Knowledge Base
World Of
CCM Link
Copyright 2008 iCMG. All rights reserved.
Site Index | Contact Us | Legal & Privacy Policy