Compiling the connector

Once you have written the connector's application-specific component, you must compile it into an executable format. This section provides information on how to compile and link a connector.

This section provides the following information:

Compiling and linking a C++ connector

To build the application-specific component of the connector, you need to include the connector header file, include any other required header files, compile the source files, and link CwConnector.lib to create the connector's dynamically loadable library (DLL).

On a Windows platform, use the MicroSoft Visual C++ 6.0 programming environment to build your connector, and follow these instructions:

  1. Make sure that the system PATH variable includes CwConnector.dll, which is in the bin subdirectory of the product directory.
  2. In the Project Settings window under C/C++, add CDKIMPORT to the Preprocessor definitions for the project.
  3. In Project Settings, C/C++, Additional include directories under the Preprocessor category, add:
  4. Define the information displayed in the Version tab of the Properties window for your connector DLL. Follow these steps:
    1. Create a file named ConnectorVersion.h and define the constants for your connector, such as Product Name and Product Version. A sample for this file is located in the following subdirectory of the product directory:
      DevelopmentKits\cdk\samples\sampleconnector\include
       

      Note:
      This sample ConnectorVersion.h file provides values for the Product Name and Product Version. Make sure you change these sample values to values that are appropriate for your connector. To check the version of a DLL, right-click on the DLL and choose the Properties>Version tab. The correct version must appear here.
    2. In the project file, make sure that the following file is added to the project:
      DevelopmentKits\cdk\ConnectorVersion.rc
       
    3. In the Additional Resources Include section, make sure the following include directories exist:
      • ..\..\generic_include
      • the include directory for your connector

    The Version window uses the files ConnectorVersion.rc and generic_include\CxResourceVersion.h, which are shipped with the CDK. You need to define the ConnectorVersion.h file for your connector.

  5. In the Project Setting Link tab, add libraries for CwConnector.lib to your project as follows:
  6. Compile and link the connector.
  7. Create the C++ connector's library file, which is a dynamically loadable library (DLL).

    By convention, connector DLL files are named to match the connector's unique name. This connector name uniquely identifies the connector. For more information, see The connector definition name.

    For example, for a C++ connector with a connector name of MyCPP, the name of its DLL is:

    MyCPP.dll
     

Running a debug version of a C++ connector

Use the MicroSoft Visual C++ 6.0 programming environment to run a debug version of a C++ connector. Assuming that the WebSphere Business Integration Adapters product is installed into a directory that ProductDir represents, to run a debug version of a C++ connector, set the executable for the debug session under Project Settings to the following:

ProductDir\bin\java.exe
 

In the program arguments, set the debug parameters to:

-Dorg.omg.CORBA.ORBClass=com.inprise.vbroker.orb.ORB 
 -Dorg.omg.CORBA.ORBSingletonClass=com.inprise.vbroker.orb.ORB 
 -Duser.home=D:\Crossworlds 
 -classpath D:\crossworlds\lib\crossworlds.jar;
 D:\crossworlds\lib\crossworlds.jar;D:\crossworlds\lib\rt.jar;
 D:\crossworlds\lib\vbjorb.jar;D:\crossworlds\lib\vbjapp.jar;
 D:\crossworlds\lib\mq.jar AppEndWrapper -ddllName 
 -nconnectorName -sserverName
 

Copyright IBM Corp. 1997, 2003