Building C++ XML projects (Windows)
First, generate your library from your XML Schema. This generates all project, header and source files required. You can then create a new C++ project for your application using Microsoft Visual Studio.
Using a shared CRT
This demonstrates how to prevent heap asserts when objects are cleaned up. (See also GPF when using strings ).
In debug the CRT keeps track of all the memory it allocated, when memory is deleted it checks to see it actually allocated it. If it didn't it asserts. If you link your project statically against the CRT ib (/ML, /MLd, /MT, /MTd), then the dll, and the exe have their own version of the CRT, and thus 2 lists of memory that have been allocated. A problem arises if memory is allocated in one and freed in another. Linking against the shared CRT DLL (/MD,/MDd) solves this problem.
Change C++ Compiler Options
For an Exe
Debug - /MLd to /MDd
Release - /ML to /MD
For a Dll
Debug - /MTd to /MDd
Release - /MT to /MD
Also you will need to Enable Run-Time Type Information (RTTI):
Add the /GR compile option to all builds
Linking to your Libray
In order to use the generated code you must link to it, and also to our runtime library. This section describes the libraries you must link to and the library paths that need setting up.
NOTE: When you build your library from the generated code, Visual Studio defaults to Static Debug as Active Configuration.
Your new project needs access to the standard header files we distribute, and the header files that you generated (when you ran the wizard).
Ensure visual studio can see the following can see the include paths
[Liquid Technologies install dir]\XmlDataBinder16\Redist16\cpp\include
[The path where you generated you XML Binding Library to]
The build version you require further depends on the C Runtime version that your compiler is using. The 32 bit dll files are found in the ?Redist16\cpp\win32\bin? folder and corresponding lib files in the ?Redist16\cpp\win32\lib? folder, and the 64 bit dll files are found in the ?Redist16\cpp\win64\bin? folder and corresponding lib files in the ?Redist16\cpp\win64\lib? folder.
The Liquid Runtime libraries for Windows use the following naming convention:
Release libraries: LtXmlLib16_vcVV.dll
Debug Libraries: LtXmlLib16D_vcVV.dll
Unicode Release libraries: LtXmlLib16U_vcVV.dll
Unicode Debug Libraries: LtXmlLib16UD_vcVV.dll
64 bit libraries: LtXmlLib16_vcVVx64.dll
XP specific libraries: LtXmlLib16_vcVV_xp.dll
Where VV is the C++ version you are using.
A 32 bit non-Unicode Release library using C++ 14.1 would look like:
Whereas a 64 bit Unicode Debug library using C++ 14.1 specifically for XP would look like:
Ensure the dlls are on the path or in the same directory as the target file.
Running the code
Your new project needs access to the standard Liquid Technologies Runtime dll, and the dll that you compiled from the new XML Data Binding component you just generated.
© 2001-2010 Liquid Technologies Limited. All rights reserved. Privacy Statement