I tried to build DCMTK on win32 (XP) with mingw 4.5.0, and I found a few problems.
Nothing difficult to solve, but just to make you know, here is my solution.
DCMTK version: 3.5.5_20100723 snapshot
(and also directly from the git repository, commit 2d1d3d9a2eaef57a8e218097f787ae1b8339fc87)
- - ./configure runs without error,
- 'make all' builds ofstd, then some tests, and then fails on oflog because the Makefile tells it to compile unixsock.cc instead of winsock.cc and some other windows specific files.
I have used the COMSPEC environment variable to detect win32, but maybe there is a better solution.
Then winsock.cc did not compile because of a missing #include <stdexcept> (for the throw std::runtime_error).
All ran smoothly then until end of install-all.
So here is a small patch with the changes I described, I hope it can be usefull.
Regards.
Code: Select all
diff -ur dd/oflog/libsrc/winsock.cc dcmtk/oflog/libsrc/winsock.cc
--- dd/oflog/libsrc/winsock.cc 2010-08-12 07:59:41 +0000
+++ dcmtk/oflog/libsrc/winsock.cc 2010-08-12 07:25:31 +0000
@@ -20,7 +20,6 @@
//#include <cassert>
//#include <vector>
-#include <stdexcept>
#include "dcmtk/oflog/helpers/socket.h"
#include "dcmtk/oflog/helpers/loglog.h"
diff -ur dd/oflog/libsrc/Makefile.in dcmtk-3.5.5_20100723/oflog/libsrc/Makefile.in
--- dd/oflog/libsrc/Makefile.in 2010-08-11 21:40:14 +0000
+++ dcmtk-3.5.5_20100723/oflog/libsrc/Makefile.in 2010-08-11 21:41:01 +0000
@@ -17,12 +17,18 @@
LOCALINCLUDES = -I$(ofstddir)/include
LOCALDEFS =
+ifdef COMSPEC
+sockobjs:=winsock.o windebap.o winconap.o ntelogap.o
+else
+sockobjs:=unixsock.o
+endif
+
objs = oflog.o apndimpl.o appender.o config.o consap.o \
factory.o fileap.o filter.o globinit.o hierarchy.o hierlock.o \
layout.o logger.o logimpl.o logevent.o loglevel.o loglog.o lloguser.o \
ndc.o nullap.o objreg.o patlay.o pointer.o property.o \
rootlog.o sleep.o socketap.o sockbuff.o socket.o strhelp.o \
- syncprims.o syslogap.o threads.o timehelp.o unixsock.o
+ syncprims.o syslogap.o threads.o timehelp.o $(sockobjs)
library = liboflog.$(LIBEXT)