Libxml2 include problems with Paladin

I’m creating a simple application in Paladin that requires libxml2. I have the devel package installed and have the .so checked in “Change system libraries…”, but I keep running into an issue with the headers.

#include <libxml/xmlreader.h>
#include <libxml/parser.h>

Doesn’t work, but this finds the files:

#include <libxml2/libxml/xmlreader.h>
#include <libxml2/libxml/parser.h>

Then my build breaks because the headers in those files reference the other headers like

#include <libxml/xmlversion.h>

I’ve tried adding:

SYSTEMINCLUDE=B_FIND_PATH_DEVELOP_HEADERS_DIRECTORY/libxml 

That’s still giving an error though. Am I missing something obvious?

Here’s my whole .pld file:

NAME=Zed
TARGETNAME=Zed
PLATFORM=HaikuGCC4
SCM=git
GROUP=Source files
EXPANDGROUP=yes
SOURCEFILE=App.cpp
DEPENDENCY=MainWindow.h
SOURCEFILE=MainWindow.cpp
SOURCEFILE=MainWindow.h
LOCALINCLUDE=.
SYSTEMINCLUDE=B_FIND_PATH_DEVELOP_HEADERS_DIRECTORY/be
SYSTEMINCLUDE=B_FIND_PATH_DEVELOP_HEADERS_DIRECTORY/cpp
SYSTEMINCLUDE=B_FIND_PATH_DEVELOP_HEADERS_DIRECTORY/posix
LIBRARY=B_FIND_PATH_DEVELOP_LIB_DIRECTORY/libbe.so
LIBRARY=B_FIND_PATH_DEVELOP_LIB_DIRECTORY/libxml2.so
LIBRARY=B_FIND_PATH_DEVELOP_LIB_DIRECTORY/libyaz.so
LIBRARY=B_FIND_PATH_DEVELOP_LIB_DIRECTORY/libyaz_icu.so
RUNARGS=
CCDEBUG=no
CCPROFILE=no
CCOPSIZE=no
CCOPLEVEL=0
CCTARGETTYPE=0
CCEXTRA=
LDEXTRA=

libyaz is being included correctly.

Your idea with adding it to SYSTEMINCLUDE seems correct,but the path isn’t,try this:

SYSTEMINCLUDE=B_FIND_PATH_DEVELOP_HEADERS_DIRECTORY/libxml2

Notice the 2 at the end.
Your try made it look at libxml/libxml/xmlversion.h when writing #include <libxml/xmlversion.h>.

Checking pkg-config reveals:

~> pkg-config --cflags libxml-2.0 
-I/packages/libxml2-2.12.9-1/.self/develop/headers/libxml2 -I/packages/zlib-1.3.1-4/.self/develop/headers

So maybe you jus need: #include <xmlreader.h> … ?

Hmm. I didn’t get this working with libxml2, but did get libxml+±5 working. I had Paladin generate a Makefile and then added libxml++
to the system include path.

## Haiku Generic Makefile v2.6 ##

## Fill in this file to specify the project being created, and the referenced
## Makefile-Engine will do all of the hard work for you. This handles any
## architecture of Haiku.

# The name of the binary.
NAME = Zed
TARGET_DIR = .

# The type of binary, must be one of:
#	APP:	Application
#	SHARED:	Shared library or add-on
#	STATIC:	Static library archive
#	DRIVER: Kernel driver
TYPE = APP

# 	If you plan to use localization, specify the application's MIME signature.
APP_MIME_SIG = 

#	The following lines tell Pe and Eddie where the SRCS, RDEFS, and RSRCS are
#	so that Pe and Eddie can fill them in for you.
#%{
# @src->@ 

#	Specify the source files to use. Full paths or paths relative to the 
#	Makefile can be included. All files, regardless of directory, will have
#	their object files created in the common object directory. Note that this
#	means this Makefile will not work correctly if two source files with the
#	same name (source.c or source.cpp) are included from different directories.
#	Also note that spaces in folder names do not work well with this Makefile.
SRCS =  App.cpp \
 MainWindow.cpp

#	Specify the resource definition files to use. Full or relative paths can be
#	used.
RDEFS = 

#	Specify the resource files to use. Full or relative paths can be used.
#	Both RDEFS and RSRCS can be utilized in the same Makefile.
RSRCS = 

# End Pe/Eddie support.
# @<-src@ 
#%}

#	Specify libraries to link against.
#	There are two acceptable forms of library specifications:
#	-	if your library follows the naming pattern of libXXX.so or libXXX.a,
#		you can simply specify XXX for the library. (e.g. the entry for
#		"libtracker.so" would be "tracker")
#
#	-	for GCC-independent linking of standard C++ libraries, you can use
#		$(STDCPPLIBS) instead of the raw "stdc++[.r4] [supc++]" library names.
#
#	- 	if your library does not follow the standard library naming scheme,
#		you need to specify the path to the library and it's name.
#		(e.g. for mylib.a, specify "mylib.a" or "path/mylib.a")
LIBS =  /boot/system/develop/lib/libbe.so \
 /boot/system/develop/lib/libcjson.so \
 /boot/system/develop/lib/libcjson_utils.so \
 /boot/system/develop/lib/libxml++-5.0.so \
 /boot/system/develop/lib/libyaz.so \
 $(STDCPPLIBS)

#	Specify additional paths to directories following the standard libXXX.so
#	or libXXX.a naming scheme. You can specify full paths or paths relative
#	to the Makefile. The paths included are not parsed recursively, so
#	include all of the paths where libraries must be found. Directories where
#	source files were specified are	automatically included.
LIBPATHS = 

#	Additional paths to look for system headers. These use the form
#	"#include <header>". Directories that contain the files in SRCS are
#	NOT auto-included here.
SYSTEM_INCLUDE_PATHS =  /boot/system/develop/headers/be \
 /boot/system/develop/headers/c++ \
 /boot/system/develop/headers/posix \
 /boot/system/develop/headers/libxml++-5.0 \
 

 
#	Additional paths paths to look for local headers. These use the form
#	#include "header". Directories that contain the files in SRCS are
#	automatically included.
LOCAL_INCLUDE_PATHS =  . \
 boot/system/develop/headers


#	Specify the level of optimization that you want. Specify either NONE (O0),
#	SOME (O1), FULL (O2), or leave blank (for the default optimization level).
OPTIMIZE := NONE

# 	Specify the codes for languages you are going to support in this
# 	application. The default "en" one must be provided too. "make catkeys"
# 	will recreate only the "locales/en.catkeys" file. Use it as a template
# 	for creating catkeys for other languages. All localization files must be
# 	placed in the "locales" subdirectory.
LOCALES = 

#	Specify all the preprocessor symbols to be defined. The symbols will not
#	have their values set automatically; you must supply the value (if any) to
#	use. For example, setting DEFINES to "DEBUG=1" will cause the compiler
#	option "-DDEBUG=1" to be used. Setting DEFINES to "DEBUG" would pass
#	"-DDEBUG" on the compiler's command line.
DEFINES = 

#	Specify the warning level. Either NONE (suppress all warnings),
#	ALL (enable all warnings), or leave blank (enable default warnings).
WARNINGS = 

#	With image symbols, stack crawls in the debugger are meaningful.
#	If set to "TRUE", symbols will be created.
SYMBOLS := 

#	Includes debug information, which allows the binary to be debugged easily.
#	If set to "TRUE", debug info will be created.
DEBUGGER := 

#	Specify any additional compiler flags to be used.
COMPILER_FLAGS = 

#	Specify any additional linker flags to be used.
LINKER_FLAGS = 

#	(Only used when "TYPE" is "DRIVER"). Specify the desired driver install
#	location in the /dev hierarchy. Example:
#		DRIVER_PATH = video/usb
#	will instruct the "driverinstall" rule to place a symlink to your driver's
#	binary in ~/add-ons/kernel/drivers/dev/video/usb, so that your driver will
#	appear at /dev/video/usb when loaded. The default is "misc".
DRIVER_PATH = 

## Include the Makefile-Engine
DEVEL_DIRECTORY := \
	$(shell findpaths -r "makefile_engine" B_FIND_PATH_DEVELOP_DIRECTORY)
include $(DEVEL_DIRECTORY)/etc/makefile-engine