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

  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 the dynamically linked TAO libraries. They also assume that you have unpacked the ACE+TAO source kit into a directory called C:\ACE_wrappers.

  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 directories to the include path:

    C:\ACE_wrappers
    C:\ACE_wrappers\TAO
    C:\ACE_wrappers\TAO\orbsvcs
    Tip: By entering your paths prefixed with "\\?\", such as \\?\C:\ACE_wrappers, you can 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:\ACE_wrappers\bin\Dynamic\Release

  8. Add these conditional defines:

    WIN32
    ACE_HAS_DLL=1
    TAO_HAS_DLL=1
    TAO_ORBSVCS_HAS_DLL=1
    ACE_USE_RCSID=0

  9. Switch to the Compiler page, enable "selected" warnings only, and then disable these warnings:

    Function should return a value (-wrvl)
    Parameter is never used (-wpar)
    Unreachable code (-wrch)

  10. Close the Project Options dialog.

  11. 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 ORBSVCS_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

  12. Build your application.

  In this section

 Introduction 

 Obtaining TAO 

 Building TAO 

 Using TAO 

 Patches 

 Support 

 Feedback 


Copyright © 2000-2002 Tenermerx Pty Ltd