[vtkusers] Building VTK application with Visual Studio 2008

John Drescher drescherjm at gmail.com
Fri May 1 12:26:30 EDT 2009


On Fri, May 1, 2009 at 12:07 PM, Alexandru Duţu <alex.dutu at gmail.com> wrote:
> I forgot to mention that if I build in debug the linker tells me this
> "Linking...
> LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other
> libs; use /NODEFAULTLIB:library"
>
> So I used this option for the linker /NODEFAULTLIB:MSVCRT and I got much
> more errors form this option.
> Also I tried to build the examples and I got linking errors so some examples
> were not built. The error I got for the failed builds is: "LINK : fatal
> error LNK1104: cannot open file 'vtkRendering.lib' "
> I checked in the vtk_build_folder/bin/release/  for vtkRendering.lib and it
> is not there, but the library exists in the installation forder "c:\Program
> Files\VTK\lib\vtk-5.4"
> I do not realize what am I doing wrong.
> Can anybody please help

I highly recommend that you use cmake to generate your project file
for your application. It will take some time to get used to for a
windows programmer. I have written > 600K lines of MFC in the last 10
or so years so I would definitely be one of those.. Anyways it solves
all of these problems and also simplifies things if you ever want to
compile your application on a different compiler. Right now I develop
my application (Qt + VTK + ITK)  under VS2005 under windows 32 bit XP
but also use VS2008 under 64 bit Windows7 and gcc 4.4 under 64 gentoo
linux with the same exact CMakeLists.txt files. I have everything in
cvs and the generated stuff (like make files or visual studio project
files are not in the repository. Also the separate build and binary
folders that cmake  make using cvs or backups easy since there is no
junk in the source tree and noting of value in the binary tree.

When my current project is over I plan to go back and generate
CMakeLists.txt files for all my code and get the project files out of
the cvs. One reason is that will help with porting code and
maintenance since I do not need to juggle 3 versions of visual studio
project files for each project anymore..

John



More information about the vtkusers mailing list