Showing posts with label libxml. Show all posts
Showing posts with label libxml. Show all posts

Friday, January 19, 2007

C++: LibXML in Borland C++ Builder 5

The key to this solution is using a command-line utility that comes with BCB5 called implib.exe which creates a borland-type .lib file from a win32 .dll

Goal:
Get a simple C++ libxml code example to work (from http://xmlsoft.org/examples/index.html)

What to do:
Okay the first thing you need to do is download win32 libxml from http://www.zlatkovic.com/libxml.en.html

but it has certain dependencies so you will want to fetch the binaries:
* libxml2, the XML parser and processor.
* libxslt, the XSL and EXSL Transformations processor.
* xmlsec, the XMLSec and XMLDSig processor.
* xsldbg, the XSL Transformations debugger.
* openssl, the general crypto toolkit.
* iconv, the character encoding toolkit.
* zlib, the compression toolkit.

Then you three types of files in each project, .dll .lib and .h. The problem with these .lib files is that these .lib files are compiled for Microsoft Visual Studio. But in borland the way to create lib files is using implib.exe included in all distributions of borland c++ builder. I run

implib.exe -a zlib.lib zlib.dll

to create a zlib.lib for borland. Then I do the same thing for the other dlls.

Then add the .lib into the borland project and then source code examples will work.

Hooray for implib!

source(s)
http://www.gantless.com/borland.html (implib)
http://www.zlatkovic.com/libxml.en.html (libxml)
http://xmlsoft.org/examples/index.html (libxml examples)