Home > Programming > CORBA > TAO with C++Builder > Using TAO >
Setting up a Console Application to use TAO

The following instructions are for use with a recent versions of ACE+TAO. If you are using TAO 1.1 please use these instructions instead.

  1. These instructions assume you want to create an executable that is dynamically linked to TAO. To do this you need to have built a release version of dynamically linked TAO libraries and installed ACE+TAO into a directory called C:\ACETAO. Please note that "installed" means having run

    make -f Makefile.bor -DINSTALL_DIR=C:\ACETAO install
    at the completion of your build, as shown in the build instructions. The C:\ACETAO directory should contain sub-directories called bin, lib and include.

  2. Create a new console application by going File|New and using the Console Wizard.

  3. TAO uses the ACE library, so you need to initialise ACE from your program. This will be done automatically provided your main function has the argc and argv parameters:

    #include <tao/corba.h>
    
    int main(int argc, char* argv[])
    {
      // ...
    }

  4. Go to Project|Options, then to the Linker page and make sure that "Use dynamic RTL" is checked.

  5. Still in the Project Options dialog, go to the Directories/Conditionals page.

  6. Add the following directory to the include path:

    C:\ACETAO\include
    Tip: By entering your paths prefixed with "\\?\", such as \\?\C:\ACETAO\include, you may be able to prevent C++Builder from automatically changing them to relative paths when you close the Project Options dialog.

  7. Add this directory to the library path:

    C:\ACETAO\lib

  8. Close the Project Options dialog.

  9. Go to Project|View Makefile (for C++Builder 5 Project|Edit Option Source) and add the following libraries to the end of the SPARELIBS line:

    ACE_b.lib TAO_b.lib
    You may add other TAO libraries as required for the CORBA Services. For example, to use the Naming service you would add:
    TAO_CosNaming_b.lib
    You should also make sure that the LIBRARIES variable is on the ALLLIB line. For example, with C++Builder 4:
    ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cw32mti.lib

  10. Build your application.

  In this section

 Introduction 

 Obtaining TAO 

 Building TAO 

 Using TAO 

 Patches 

 Support 

 Feedback 


Copyright © 2000-2002 Tenermerx Pty Ltd