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.
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.
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
wxxml2/include
,wxxml2/thirdparty/libxml2/include
,wxxml2/thirdparty/libiconv/include
folders.
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.