How to use SourcePro with LEIF

Article ID: 1236
Last updated: 01 Sep, 2009
Article ID: 1236
Last updated: 01 Sep, 2009
Revision: 1
Views: 1434
Posted: 04 Oct, 2005
by --
Updated: 01 Sep, 2009
by

Problem


This article will explain the necessary steps to use SourcePro with LEIF 2.x.  Please note; the version of SourcePro is a full product version and not the SourcePro binaries that are shipped with LEIF.  

There are there three main sections; the first explains how to integrate LEIF and SourcePro when both the libraries are built with exactly the same build options, so they have the same build tag.  In the second section, we explain the additional changes which must be applied if the build tags of the libraries are different.  So for example in this case, you may be using a 12d (release dynamic) version of LEIF with a 15d (debug dynamic) of SourcePro.

In the third and final section, we detail the extra steps required to use SourcePro version 3 with LEIF 2.x.  Please note; steps 1 and 2 are for versions SourcePro 4 and above and SourcePro versions 1 and 2 are not covered in this article. 


Cause


Using the -SourcePro flag, LEIF allows you to generate code which uses SourcePro components.  If you are a SourcePro customer, you may extend your applications through any additional SourcePro products that you own; or you may simply want to use LEIF with an older/newer full product release of SourcePro.

Please note; LEIF 2.0-2.2 are shipped with SourcePro 6.


Action


Section 1

The version of SourcePro which will be used with LEIF must be compatible with LEIF and in some cases, a new buildspace will have to be created.  The LEIF 2.2 User Guide (Appendix A1) explains in detail how to create a buildspec using RCB for SourcePro 6.

Windows example:

Using your wsdl or schema, generate code and edit the generated makefile as follows:

1. Change the BUILDSPACE variable to point to the SourcePro installation directory.

BUILDSPACE=C:RogueWaveSourceProEd7

2. Add a RW_HOME variable to point to the LEIF installation directory.

RW_HOME= $(RW_HOME)

3. Edit the include line:  

INCLUDES= -I$(BUILDSPACE) -I$(RW_HOME) -I$(SRCDIR)

4. Edit the linker flags:

LINKER_FLAGS=/nologo /LIBPATH:$(BUILDSPACE)lib /LIBPATH:$(RW_HOME)lib

5. And archiver flags:

ARCHIVER_FLAGS=/LIBPATH:$(BUILDSPACE)lib /LIBPATH:$(RW_HOME)lib /dll /out:

6. Update the location of the LEIF libraries 

XSDREQLIBS= $(RW_HOME)/lib/leifcore$(SBTAG).$(LIBSUFFIX) $(RW_HOME)/lib/xmlol$(SBTAG).$(LIBSUFFIX)

7. And compile the code.

Please note the makefile lines above are for illustration purposes only and are from a Windows/MSVC 6.0 makefile.

Section 2

Below are the additional changes which need to be made if the build options (build tag) for SourcePro is different from that of LEIF.

1. Change the SBTAG to the build tag of SourcePro (for example: 15d) 

2. Change -D_RWCONFIG=$(SBTAG) to:

-D_RWCONFIG_$(SBTAG) -D_RWCONFIG_$(TAG)

3. Edit all XSDREQLIBS, XSDLINKLIBS, WSDL_REQLIBS, WSDL_LINKLIBS so file names are correct.  

For example:

XSDREQLIBS= $(RW_HOME)/lib/leifcore$(SBTAG).$(LIBSUFFIX)

will need to be changed to

XSDREQLIBS= $(RW_HOME)/lib/leifcore$(TAG).$(LIBSUFFIX)

4. Ensure the LEIF include paths use RW_HOME and the SourcePro paths use BUILDSPACE

Note: the includes should put the SourcePro (BUILDSPACE) files before the LEIF (RW_HOME) files.

Section 3

1. Add the rwerr.h header file as follows to the <myProject>NotificationSkeleton.cpp and <myProject>Skeleton.cpp.

"#include <rw/rwerr.h>" 

Recent version of LEIF includes this file  implicitly, but it must be explicitly specified for SourcePro Edition 3.  So for example, if you were working with the forecast example provided in the <LEIF-install-dir>examples soapworxForecast, you would need to include the above header in ForecastNotificationSkeleton.cpp and ForecastSkeleton.cpp.

2. The following changes must be made in the generated makefile

2a. add "-DNOMINMAX -DWIN32 -Zc:wchar_t" to the CPP_FLAGS macro. "-Zc:wchar_t" may only be required for Rogue Wave standard library builds.

2b. add "std$(SBTAG).lib" to the WSDL_LINKLIBS macro. (This is only required for RogueWave standard library).

This article was:   Helpful | Not helpful
Report an issue
Article ID: 1236
Last updated: 01 Sep, 2009
Revision: 1
Views: 1434
Posted: 04 Oct, 2005 by --
Updated: 01 Sep, 2009 by

Others in this category