mingw problems

All other questions regarding DCMTK

Moderator: Moderator Team

Message
Author
ermando.ferrari
Posts: 10
Joined: Thu, 2008-02-07, 11:20

mingw problems

#1 Post by ermando.ferrari »

dcmtk compile well with GNU Make 3.81, but with GNU Make 3.82.90 installed with QT5.1 show a lot of errors

i.e.

../../../LIBS/dcmtk-3.6.1_20121102/ofstd/include/dcmtk/ofstd/ofstd.h:651:23: error: expected unqualified-id before 'unsigned'
static int rand_r(unsigned int &seed);

that because in the file

C:\qt\qt5.1.1\tools\mingw48_32\i686-w64-mingw32\include\pthread.h : 462
#ifndef rand_r
#define rand_r(__seed) (__seed == __seed ? rand () : rand ())
#endif

../../../LIBS/dcmtk-3.6.1_20121102/ofstd/include/dcmtk/ofstd/offile.h:385:11: error: cannot convert 'bool' to 'FILE* {aka _iobuf*}' in assignment
file_ = _popen(command, modes);
maybe an explicit cast?

Is a patch for the new toolchain planned?

regards

J. Riesmeier
DCMTK Developer
Posts: 2503
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: mingw problems

#2 Post by J. Riesmeier »

The first issue is a known one and should be fixed before the the next official DCMTK release.
Also the other issue will be fixed since MINGW is one of the platforms typically used during the cross-platform testing phase in the context of releasing a new version.

In fact, we already have a bug entry (#389) in our internal issue tracker that covers some of your problems...
I just increased the priority (i.e. target version) from "next release" to "one of the next snapshots". I hope this helps.

ermando.ferrari
Posts: 10
Joined: Thu, 2008-02-07, 11:20

Re: mingw problems

#3 Post by ermando.ferrari »

thank you for answer, and say hello to Oldenburg horse statue from me :D (maybe you have a picture of mine on it)

J. Riesmeier
DCMTK Developer
Posts: 2503
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: mingw problems

#4 Post by J. Riesmeier »

and say hello to Oldenburg horse statue from me :D
Will do :)
(maybe you have a picture of mine on it)
I saw the picture but it was my colleague Michael who took it (and who saw you on that horse ;-) ).

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

Re: mingw problems

#5 Post by Michael Onken »

:-) Remember it well... hope you return for a horse ride, it's still there waiting!

ermando.ferrari
Posts: 10
Joined: Thu, 2008-02-07, 11:20

Re: mingw problems

#6 Post by ermando.ferrari »

hi everybody (especially to the horse)
any news about the patch? We can't use QT5 for that...

Jan Schlamelcher
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 318
Joined: Mon, 2014-03-03, 09:51
Location: Oldenburg, Germany

Re: mingw problems

#7 Post by Jan Schlamelcher »

The problems regarding mingw should have been fixed in this commit:
http://git.dcmtk.org/web?p=dcmtk.git;a= ... 66bfa743f3

You might use the just released snapshot:
http://dicom.offis.de/download/dcmtk/sn ... 617.tar.gz

I use mingw to test dcmtk under windows quite often, so this should definitely work.

ermando.ferrari
Posts: 10
Joined: Thu, 2008-02-07, 11:20

Re: mingw problems

#8 Post by ermando.ferrari »

thank you, now I have some problems whith off64_t and fpos64_t definition, but I think is a mingw configuration problem...

Jan Schlamelcher
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 318
Joined: Mon, 2014-03-03, 09:51
Location: Oldenburg, Germany

Re: mingw problems

#9 Post by Jan Schlamelcher »

Could you give me more details about these problems? Maybe i can create a workaround.
FYI i use this mingw version:
http://sourceforge.net/projects/mingw-w ... z/download

ermando.ferrari
Posts: 10
Joined: Thu, 2008-02-07, 11:20

Re: mingw problems

#10 Post by ermando.ferrari »

i downloaded qt5 for windows from http://qt-project.org/downloads
mingw is provided whith installation package

mingw32-make -v replies:
GNU Make 4.0.90
Built for Windows32

ermando.ferrari
Posts: 10
Joined: Thu, 2008-02-07, 11:20

Re: mingw problems

#11 Post by ermando.ferrari »

ok, with mingw downloaded by sourceforge it compile... I think problem is in mingw provided with QT configuration
maybe in the solution is in the _mingw_off_t.h defines

Jan Schlamelcher
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 318
Joined: Mon, 2014-03-03, 09:51
Location: Oldenburg, Germany

Re: mingw problems

#12 Post by Jan Schlamelcher »

It seems that i have identified the problem. Your QT-Version is 32 bit software and contains a 32 bit mingw. I've been working with a 64 bit mingw only so far, which was also true when i created the mingw fix. Looking at dcmtk/ofstd/include/dcmtk/ofstd/offile.h, lines 79, 384 and 448 you can see that !defined(__MINGW64__) is queried.
To my understanding, the fix was necessary for the 64 bit version of mingw only. As i understand it now, it's not about target architecture, but instead about which mingw distribution you use. QT uses the 32 bit version of the mingw-w64 project, which is different to the "regular" mingw 32 bit version and also needs the fix.
For now i would recommend patching the mentioned occurences of __MINGW64__ to __MINGW32__ in your local dcmtk version. I think it would be a bad idea to apply this fix to the public dcmtk, since it would possibly break the "regular" mingw distribution (although my personal opinion is that this version sucks and you should always use the mingw-w64 distribution, even for 32 bits [QT seems to be agreeing with me in this regard]).
I think i will create a configure test which will detect the right version to use in the near future, so it will work on any mingw distribution then.

ermando.ferrari
Posts: 10
Joined: Thu, 2008-02-07, 11:20

Re: mingw problems

#13 Post by ermando.ferrari »

GREAT... it compile...
thank you very much for the support

ermando.ferrari
Posts: 10
Joined: Thu, 2008-02-07, 11:20

Re: mingw problems

#14 Post by ermando.ferrari »

sorry again...
when I compile the library using makefiles generated by cmake there are no problems, but when I compile my project using makefiles generated by qmake there are compiler errors:

C:\LIBS\DCMTK\mingw32\include\dcmtk\oflog\tracelog.h:59: error: invalid conversion from 'const wchar_t*' to 'char' [-fpermissive]
logger.forcedLog(TRACE_LOG_LEVEL, DCMTK_LOG4CPLUS_TEXT("ENTER: ") + msg, file, line);
^
C:\LIBS\DCMTK\mingw32\include\dcmtk\oflog\tracelog.h:64: error: invalid conversion from 'const wchar_t*' to 'char' [-fpermissive]
logger.forcedLog(TRACE_LOG_LEVEL, DCMTK_LOG4CPLUS_TEXT("EXIT: ") + msg, file, line);
^
(the ^ is indented whith msg)

C:\LIBS\DCMTK\mingw32\include\dcmtk\oflog\logmacro.h:106: error: no matching function for call to 'dcmtk::log4cplus::Logger::getInstance(const tchar*&)'
return Logger::getInstance (logger);
^

I tried with
#pragma GCC diagnostic warning "-fpermissive"
but it don't patch the last error

maybe I have to set some gcc flag in the .pro file?

Jan Schlamelcher
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 318
Joined: Mon, 2014-03-03, 09:51
Location: Oldenburg, Germany

Re: mingw problems

#15 Post by Jan Schlamelcher »

It seems to me, that you define "UNICODE" in your project. This is currently not supported by DCMTK.

Post Reply

Who is online

Users browsing this forum: Baidu [Spider] and 1 guest