Building libxml2

I’m building libxml2 version 2.6.19 on QNX 6.3
When I do a configure for mutithreaded there is a problem because there is no -lpthread lib under QNX, although it obviously has all the pthread features required.

% ./configure --with-threads

part of config.log output is shown at end of message. Full config.log is attached.

Has anybody got a fix for this?



configure:27917: result: yes
configure:27952: checking for pthread.h
configure:27959: result: yes
configure:27964: checking for pthread_join in -lpthread
configure:27994: gcc -o conftest -g -O2 -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls conftest.c -lpthread -lsocket >&5
conftest.c:86: warning: function declaration isn’t a prototype
conftest.c:89: warning: function declaration isn’t a prototype
/usr/qnx630/host/qnx6/x86/usr/ntox86/bin/ld: cannot find -lpthread
collect2: ld returned 1 exit status
configure:28000: $? = 1
configure: failed program was:
| /* confdefs.h. */

You do not need to link in the posix threads stuff explicitly (-lpthread option points linker to look for
All the threads stuff is in in QNX. So there is only way out: look throught the configure script and remove “-lpthread” from LDFLAGS in the appropriate section.
OR you may run configure as usual and then remove “-lpthread” from all of the Makefiles.

This is FAST way.
The good way is to fix autotools configuration files (, aclocal.m4 or acinclude.m4) and add support for QNX Neutrino there.
Then rebuild configuration environment and run ./configure, then make and then make install.
Send patches to developers.

best regards
feel free to contact me on if need some help :slight_smile:

you can fetch libxml2-2.6.17 from QOpenCD ( if you are not critical about minor version

Thanks very much for the reply Mike. I take it that it still needs configure to be run with --with-threads option so that libxml knows it is running in threaded mode? I will try the prebuilt version on your website…


That is not my site :slight_smile:
it is QopenCD by Mike Gorchak - all thanks go to him

my website is

you should run configure as usual and need to point it to use threaded stuff (–with-threads)

Thanks again MikeP :laughing: and also to Mike G + friends for the time spent porting the code on his great site!