Snapshot on win32 with mingw4.5

Compilation and installation of DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
fsalab
Posts: 1
Joined: Thu, 2010-08-12, 09:09

Snapshot on win32 with mingw4.5

#1 Post by fsalab »

Hi,

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.
So I have made some modifications to the Makefile.in in oflog/libsrc/ based on CMakeLists.txt in the same directory.
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)

Michael Onken
DCMTK Developer
Posts: 2049
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

#2 Post by Michael Onken »

Hi,

I just read this post but commited a fixed version for MinGW compilation also some minutes ago (also on public git now).

I also added the include in winsock.cc and also the cmake compilation on MinGW. However, the windows-specific sources are still excluded from lib oflog, but I will check your COMSPEC approach next days to maybe enable it in the future. Thanks for sharing :-)

Best regards,
Michael

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 1 guest