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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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