[vtkusers] VC++ building linking etc

Paul Tait paul at opes.com.au
Thu Jan 30 21:25:23 EST 2003


Hi All

Couple of newbie questions concerning VC++ environment

I general like using the #pragma comment extension in VC++ so people can see
in my source file what libraries I'm using, rather than hunting round in a
DSP file after the link fails. All I have to do then is add the library path
to my options or dump the vtk libraries in a standard location

I also like to build release builds with release libraries and debug with
debug. The only way I've found to do this with microsoft is by using a
different library name
I've modified the vtk dsp files to build 2 versions and I link them with the
following code in one of my vtk source files

Would it be hard to get cmake to do this automatically. we could even use
the post build set to copy/move the files into the standard lib directory
using an environment variable like VTK_ROOT

Comments?

Paul
#pragma comment(lib, "opengl32.lib")

#pragma comment(lib, "glaux.lib")

#ifdef NDEBUG

#pragma comment(lib, "vtkCommon.lib")

#pragma comment(lib, "vtkFiltering.lib")

#pragma comment(lib, "vtkGraphics.lib")

#pragma comment(lib, "vtkImaging.lib")

#pragma comment(lib, "vtkIO.lib")

#pragma comment(lib, "vtkRendering.lib")

#else

#pragma comment(lib, "vtkCommond.lib")           "d" added for debug version

#pragma comment(lib, "vtkFilteringd.lib")

#pragma comment(lib, "vtkGraphicsd.lib")

#pragma comment(lib, "vtkImagingd.lib")

#pragma comment(lib, "vtkIOd.lib")

#pragma comment(lib, "vtkRenderingd.lib")

#endif




More information about the vtkusers mailing list