Linker errors with VS 2008

Questions regarding the DCMRT library, a DCMTK add-on that implements support for the various DICOM Radiation Therapy (RT) IODs

Moderator: Moderator Team

Post Reply
Message
Author
dalingrin
Posts: 8
Joined: Fri, 2010-05-21, 01:38

Linker errors with VS 2008

#1 Post by dalingrin » Tue, 2010-05-25, 20:35

Most of the DCMTK library works for me except for the new DCMRT module.

When I try to compile a project that links against dcmrt I get linker errors that all seem to do with "log4cplus."

Additionally, I get the infamous "warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library"

The LNK4098 error only happens if I use the new DCMRT module. I can use the rest of the module without such warnings or errors.

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#2 Post by Jörg Riesmeier » Tue, 2010-05-25, 20:46

Which version of DCMRT are you using? As far as I remember, I tried all pre-releases of DCMRT with VS 2008 Express on Windows XP (32-bit). Did you change any of the compiler flags in CMakeLists.txt?

dalingrin
Posts: 8
Joined: Fri, 2010-05-21, 01:38

#3 Post by dalingrin » Tue, 2010-05-25, 20:59

It was version from May 11th.

I'll outline the procedure I used.
First I changed all references of "/MT" in CMakeLists.txt to "/MD"
Then I used cmake gui to remove the optional modules(libpng, etc) and generated a VS 2008 project.
I used Build All in VS 2008 and then used the INSTALL project.

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#4 Post by Jörg Riesmeier » Tue, 2010-05-25, 21:02

Hmm, but the original CMake settings work without any problems? Btw, there should be no need to remove the optional modules like libpng since for the DCMRT package they are disabled by default.

dalingrin
Posts: 8
Joined: Fri, 2010-05-21, 01:38

#5 Post by dalingrin » Tue, 2010-05-25, 21:48

Ah, I found one problem. I didn't link against oflog.lib.
After linking against oflog.lib I have some further errors all relating to "ntelogap.obj."
I'm guessing there is an NT Event that I am not linking to. Any ideas?

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#6 Post by Jörg Riesmeier » Wed, 2010-05-26, 08:24

I compiled the complete DCMRT package with "/MD" and got no linker errors or warnings, so I guess that your project files are the reason for the problems.

Btw, there is a new CMake option OVERWRITE_COMPILER_FLAGS that can be used to avoid the hard-coded specification of the compiler/linker flags.

dalingrin
Posts: 8
Joined: Fri, 2010-05-21, 01:38

#7 Post by dalingrin » Mon, 2010-05-31, 21:51

I can now build the latest dcmtk. I had to change a linker parameter to inherit dependencies.
Unfortunately, I can't instantiate any class in the dcmrt module. Anytime I do, I get this error:

Code: Select all

STATUS_STACK_BUFFER_OVERRUN encountered
Or the program becomes unresponsive and I have to manually terminate.

The other dcmtk classes that are not a part of the dcmrt module seem to work just fine.

BTW, This is using C++/CLI.

dalingrin
Posts: 8
Joined: Fri, 2010-05-21, 01:38

#8 Post by dalingrin » Tue, 2010-06-01, 17:37

I tried instantiating a DRTPlanIOD object in a native visual C++ project. The program immediately crashes much like the C++/CLI project but with an access violation error.
Again, classes from the other modules like DcmFileFormat instantiate just fine.

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#9 Post by Jörg Riesmeier » Wed, 2010-06-02, 09:26

Unfortunately, I have no idea what the reason for your problems is since it works without problems for the sample programs "drtdump" and "drttest" ...

What does the debugger say?

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest