[Insight-developers] Problems with Visual Studio 2010 linkage -- any experts?

Bill Hoffman bill.hoffman at kitware.com
Fri Nov 2 17:11:51 EDT 2012


On 11/2/2012 4:34 PM, Williams, Norman K wrote:
> I was using NMAKE, and I wasn't setting
> DCMTK_OVERWRITE_WIN32_COMPILER_FLAGS to 'Off' when I got these errors.
>

So, run nmake VERBOSE=1 to see the link/compile lines.
> I don't know why my examination of the CMakeCache.txt files didn't turn up
> the different flags.  I'd think that the
> DCMTK_OVERWRITE_WIN32_COMPILER_FLAGS thing would happen at config time,
> not at build time, but I don't know.
>
If you do this:
set(CMAKE_CXX_FLAGS /foo)

Then the cache value of CMAKE_CXX_FLAGS will be ignored by cmake.  It is 
usually a bad thing to do... :)

> Windows seems really fragile in comparison to OS X and Linux.  I think
> that keeping separate Single and Multi-threaded libraries is at least 5
> years past it's sell-by date.
Windows is what it is.  You can not mix different run time libraries. 
There are similar things that can happen on other OSs.  It is just that 
MS provides a plethora of run time library options and none of them are 
compatible.  It means you have to be consistent with which run time you 
use in your code.   Linux and OS X have different problems, like not 
being able to run binaries built on other machines because the run time 
libraries are different.  On the threaded issue, there is still a 
-ptrhead option to gcc which can cause some trouble if you mix code 
compiled with and without it...


Anyway, none of this will help you get ITK build with VS 2010.   Where 
are you now?  Have you found the inconsistent flags in ITK and DCMTK  yet?

You want to look in the build tree of both and check out the flags.make 
and the build.make files:
CMakeFiles/target.dir/flags.make   // this will have the compile flags
CMakeFiles/target.dir/build.make   // this will have the link flags

I think the link flag is what you want, something like:   /MDd


-Bill











-- 
Bill Hoffman
Kitware, Inc.
28 Corporate Drive
Clifton Park, NY 12065
bill.hoffman at kitware.com
http://www.kitware.com
518 881-4905 (Direct)
518 371-3971 x105
Fax (518) 371-4573


More information about the Insight-developers mailing list