wxXml2 installation

The wxXml2 wrappers are packed in a few source files and few header files, so you could think the best way to use them is to build the source files together with the sources of your app: in this case you should just add the source & header files to your project and compile them with the standard wxWidgets flags (they support both Unicode/ANSI, shared/static, debug/release builds).

However, you should take in count that even if you include wxXml2 sources and headers in your project, you will still need to add the libxml2 and libiconv dependencies to your project.

wxXml2, in fact, is a wrapper for libxml2 and thus it depends on libxml2 and all libxml2's dependencies, too. Libxml2 depends on zlib and iconv. The first library is already built-in with wxWidgets so that there are no problems with that. Libiconv instead needs to be compiled and linked together with libxml2 and wxxml2.

So, others may find a library more portable; just choose your favourite integration mode. Below you find help about compiling wxXml2 as a library.



How to compile the wxXml2 library on win32 (with MSVC project files)

The MSVC6 project files shipped with wxXml2 do not build the required libxml2 and libiconv libraries. This is because the compilation of these "thirdparty" libraries require some steps that cannot be performed by MSVC6 project files and require to run a makefile.

If you try to use the MSVC6 project files without thirdparty libraries in wxxml2 you'll get (obviously!) a lot of linker errors about "unresolved external symbols". You can still use MSVC6 project files to build wxXml2 and its sample but you will first need to:

1) get the libxml2 and libiconv binaries (look at http://www.zlatkovic.com/libxml.en.html) and put the precompiled libraries in wxxml2;

or

2) compile for the first time wxXml2 using the makefiles (following builds of wxXml2 can be done through MSVC6 project files as long as thirdparty libraries are not deleted from wxxml2). This is probably the fastest way since libxml2 and libiconv are packed with wxXml2 now. For help about compiling wxXml2 with makefiles, please look at the section below.


How to compile the wxXml2 library on win32 (with makefiles)

To build a library from wxXml2 sources, you can use the makefiles in the BUILD folder. They support all common wx flags (WX_DEBUG=0/1, WX_UNICODE=1/0, WX_SHARED=1/0). In win32 releases you will also find that exists a "thirdparty" folder which contains the libxml2 and libiconv libraries; this is very handy on win32, where libxml2 and libiconv are always missing (not part of Microsoft sources, yet ;-)) since you just need to go in the build\ folder of wxXml2 and type:

for MSVC compiler: nmake -fmakefile.vc [same wxWidgets configuration using WX_DEBUG=0/1 WX_SHARED=0/1 WX_UNICODE=0/1 options]
for Borland compiler: make -fmakefile.bcc [same wxWidgets configuration using WX_DEBUG=0/1 WX_SHARED=0/1 WX_UNICODE=0/1 options]
for Watcom compiler: wmake -fmakefile.wat [same wxWidgets configuration using WX_DEBUG=0/1 WX_SHARED=0/1 WX_UNICODE=0/1 options]
for Mingw compiler: mingw32-make -fmakefile.gcc [same wxWidgets configuration using WX_DEBUG=0/1 WX_SHARED=0/1 WX_UNICODE=0/1 options]

Some notes: consider it normal to get thousands warnings from libxml2 and libiconv when compiling them in debug mode. It's also normal to get always the following linker warning with MSVC:

LINK : warning LNK4049: locally defined symbol "_xmlFree" imported

this is a libxml2 problem...

To help you to find the generated libraries/DLLs, I configured the build system so that all *.lib and *.dll files of libiconv and libxml2 goes in the wxxml2/lib folder. This also means that in your program you can include as new library path searched by the linker only wxxml2/lib; however you still have to add as include paths all the

folders.


How to compile the wxXml2 library on Unix-based OS

You will notice that the TAR.GZ distribution of wxXml2 comes without the libxml2 and libiconv thirdparty libraries. This is because these two libraries typically are part of all major linux distributions so that you probably won't need to download and install them. So, on Unix-based operating systems, unzip the tar.gz archive and type:

cd build

./configure

make

make install

Type "./configure --help" for more info. For any problem, feel free to contact frm@users.sourceforge.net.


After compilation, the most important thing you should do, specially if you've never used these classes before, is to build the The minimal sample of wxXml2 and read its source file. These doxygen docs are a useful and detailed reference manual to use after you learnt how wxxml2 wrappers must be used.


Generated on Thu Sep 28 14:58:01 2006 for wxXml2 by  doxygen 1.4.7