XML Security Library

LibXML2
LibXSLT
OpenSSL

Building the application with XML Security Library.

As usual, compiling and linking application with XML Security Library requires specifing correct compilation flags, library files and paths to include and library files.


Compiling and linking on Unix.

On Unix-like systems the xmlsec-config script is the simplest way to get all necessary information.

Example 1. Using xmlsec-config script in a Makefile.

PROGRAM	 	 = test
PROGRAM_FILES	 = test.c
cc	 	 = gcc
CC	 	 = gcc
LD	 	 = gcc

CFLAGS		+= -g $(shell xmlsec-config --cflags)
LDFLAGS		+= -g
LIBS 		+= $(shell xmlsec-config --libs) 

all: $(PROGRAM)

%: %.c 
	$(cc) $(PROGRAM_FILES) $(CFLAGS) $(LDFLAGS) -o $(PROGRAM) $(LIBS)

clean:
	@rm -rf $(PROGRAM)
	    

Compiling and linking on Windows.

On Windows there is no such simple and elegant solution. Please check README file in win32 folder of the library package for latest instructions. However, there are a couple general things, that you need to remember:

  • All libraries linked to your application must be compiled with the same Microsoft Runtime Libraries.

  • Static linking with XML Security Library requires additional global defines:

    #define LIBXML_STATIC
    #define LIBXSLT_STATIC
    #define XMLSEC_STATIC	    
    	     


Compiling and linking on other systems.

Well, nothing is impossible, it's only software (you managed to compile the library itself, do you?). I'll be happy to include in this manual your expirience with compiling and linking applications with XML Security Library on other platforms (if you would like to share it).



Aleksey Sanin