I have now managed to build DCMTK using Microsoft Visual Studio .NET 2003 and CMake 2.0.5, but I had a problem that stumped me for hours, so I thought I'd share the solution.
My problem was that all of the apps in the dcmpstat directory failed to link, reporting the error:
Code: Select all
LINK : fatal error LNK1181: cannot open input file 'ofstd.lib'
Initially I thought the problem was with CMake, but eventually I discovered that it is due to a limitation in Visual Studio. The cause of the problem is that the project setting "Configuration Properties->Linker->General->Additional Library Directories" has a limited length!
For all of the projects in the dcmpstat directory there are large numbers of Additional Library Directories. On my system this setting was over 2500 characters long, and Visual Studio couldn't cope. However, some of the DCMTK directories included in this list did not actually exist, and once I had deleted them everything compiled and linked without difficulty.
Would it be possible to modify the CMakeLists.txt files in the DCMTK distribution so that these non-existant directories are removed from the "Additional Library Directories" setting when the build target is Visual Studio .NET 2003?
Also, if anyone has a more recent version of Visual Studio then it would be interesting to know whether Microsoft have removed this limitation. I am using Microsoft Development Environment 2003 Version 7.1.3088
All the best,