Re: [xml] HOWTO build libxml2 with minGW & pthreads-win32



I was able to compile the lib for my environment from the CVS tree, with
only a few mods:
- In the generated "win32config.h":
* add at the beginning  "#define HAVE_PTHREAD_H" (thanks Igor!)

That is being defined on the compiler's command line, by the Makefile, if you choose to use pthreads. I cannot simply add it to win32config.h, as long win32config.h remains static, means not autogenerated.

*around line 52, in the !_MSC_VER part: protect with "#ifndef isinf" and
"#ifndef isnam" the definitions, as mingw has them

For that we must find real macros. If a function named isinf exists, then that name is not #defined when the preprocessor runs. The compiler recognises the name later. The preprocessor knows only macro names, not functions.

- tweak the makefile.mingw: minor typos corrections, more libs to search
(mingwex, iconv, pthreadGC)

That is okay. I can send you my copy, as I have fought this before. I stopped at some point puzzled why ld does not know where it is installed when called as 'ld' and not as 'gcc'. If the offending lines are edited to call the linker through gcc, it might even work.

The lib compiles cleanly. The testThreadsWin32.exe works under gdb for
TEST_REPEAT_COUNT=300, but not for 500. It does not work outside gdb, but I
suspect that using WaitForMultipleObjects() is not adequate when using
pthreads.

TestThreadsWin32 is not meant to test pthreads. Use the regular testThreads executable for that. The Win32 version tests only the Windows threads. You cannot mix the two in the same application.

My first program now compile and run :-))), but when pressing ^C, I get an
"Invalid disposition exception 0xC0000026 in kernel32.dll". This does not
occur when running under gdb. According to microsoft (
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/debug/base/
exception_record_str.asp ) "EXCEPTION_INVALID_DISPOSITION: An exception
handler returned an invalid disposition to the exception dispatcher.
Programmers using a high-level language such as C should never encounter
this exception. " . But I encounter it :-((. Any ideas?

Seems to be an unsound mixture in the exception handling scheme. Make sure that pthreads uses the same exceptions as the rest of the application.

Igor, I am not used to patches and public CVS updates, but I can send to you
my mods when things work if you are interested.

Yes, please, go ahead.

Ciao
Igor




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]