C++ Based OPC UA Client/Server/PubSub SDK
1.7.2.493
|
The following sections describe how to compile LibXml2 from source for Windows CE with Visual Studio 2008.
You will need tar to unpack the LibXml2 source package. Download and install Cygwin from https://cygwin.com/install.html. The default installation includes tar.
A Windows CE SDK is required to build LibXml2 for Windows CE. The following example uses our Windows CE SDK, you’ll have to make some adjustments regarding your own toolchain.
The actions described in the following steps may differ depending on the libraries to be compiled for debug or release mode. This will be noted in each step below if applicable.
Furthermore, it is described how to append a “d” to the filename for debug mode if you inted to use debug and release libraries side by side.
Download the most recent version of LibXml2 from http://xmlsoft.org/downloads.html. Start a cygwin terminal, navigate to the folder containing the downloaded archive and unpack it:
Open Visual Studio and create a new Win32 project called libxml2. Choose “Dll” as application type and “Empty project” at “Additional options”. it to the unpacked folder libxml2-<version>. Choose Build → Configuration Manager from the menu and pick your Windows CE platform from the menu. For our example, we want to build for Windows CE 7 on x86 using our Windows CE SDK, so we’re picking Unified_Automaiton_WCE_700 (x86).
We need to add the following source files located in the <libxml2 directory> to the solution:
Furthermore, we need to add <libxml2 directory>\win32\wince\wincecompat.c.
We have to set the following preprocessor defines:
_WIN32_WCE=$(CEVER)
UNDER_CE
WINCE
$(ARCHFAM)
$(_ARCHFAM_)
_CRT_SECURE_NO_DEPRECATE
_CRT_NONSTDC_NO_DEPRECATE
_WINDOWS
_USRDLL
CEDLL_EXPORTS
NO_SYS_TYPES_H
HAVE_STDLIB_H
_WINSOCKAPI_
_DEBUG (leave this one out in release mode)
We need the following include directories:
<libxml2 directory>
<libxml2 directory>\win32\wince
<libxml2 directory>\include
<libxml2 directory>\include\libxml
Finally, we have to adjust some linker settings.
To disable the patent-registered algorithm iconv, we have to edit the file <libxml2 directory>\include\libxml\xmlversion.h:
Now we are ready to compile the libraries.
Finally, it is necessary to copy the library files to the SDK folder structure. Create a folder named
<SDK Installation Directory>\third-party\wince<6/7>\vs<version>\libxml2
A similarly named folder, containing the precompiled LibXml2 binaries shipped with the SDK, should already exist below third-party.