[vtkusers] VTK Compile DirectX and GPU

Francois Bertel francois.bertel at kitware.com
Mon Jun 7 10:25:10 EDT 2010


Hello,

This simple example does not use CMake for discovering dependencies.
So it uses dependencies for VTK 5.0.

You better right a simple example using a CMakeLists.txt like:

# first line
cmake_minimum_required(VERSION 2.8.1 FATAL_ERROR)

project(myProject)

find_package(VTK REQUIRED)
include(${VTK_USE_FILE})

set(SRC vtk_minimal.cpp)
add_executable(myProgram ${SRC})
target_link_libraries(myProgram vtkRendering)
# last line


Or if you want to direclty deal  with a visual studio project (not
recommended) then the dependency your missing is the one about
d3d9.lib.


Regards.



On Mon, Jun 7, 2010 at 7:40 AM, Alex Southern <mrapsouthern at gmail.com> wrote:
> Hi,
>
> Im having trouble compiling my programs with vtk. I'm using the simple
> example from here,
> http://vtkblog.blogspot.com/2007/04/install-build-vtk-from-source-in-visual.html
>
> I've used Cmake and built and installed VTK and generated both the release
> and debug versions of the libraries and includes files and I have added the
> path to include and lib paths to Tools->Options->Project and Solutions->VC++
> Directories.
>
> When I compile the simple example I get the following error messages in both
> Debug and Release modes. My system is Windows 7, Visual Studio 2008 and the
> new NVIDIA GTX 480, I mention this because there is reference to
> 'GPUinfolist'.
>
> Any suggestions about this?
>
> Error    2    error LNK2019: unresolved external symbol _CLSID_WbemLocator
> referenced in function "protected: void __thiscall
> vtkDirectXGPUInfoList::ProbeInfoWithWMI(struct HMONITOR__ *,class vtkGPUInfo
> *)"
> (?ProbeInfoWithWMI at vtkDirectXGPUInfoList@@IAEXPAUHMONITOR__@@PAVvtkGPUInfo@@@Z)
>    vtkRendering.lib    vtk_minimal
>
> Error    3    error LNK2019: unresolved external symbol _IID_IWbemLocator
> referenced in function "protected: void __thiscall
> vtkDirectXGPUInfoList::ProbeInfoWithWMI(struct HMONITOR__ *,class vtkGPUInfo
> *)"
> (?ProbeInfoWithWMI at vtkDirectXGPUInfoList@@IAEXPAUHMONITOR__@@PAVvtkGPUInfo@@@Z)
>    vtkRendering.lib    vtk_minimal
>
> Error    4    error LNK2019: unresolved external symbol _Direct3DCreate9 at 4
> referenced in function "public: virtual void __thiscall
> vtkDirectXGPUInfoList::Probe(void)" (?Probe at vtkDirectXGPUInfoList@@UAEXXZ)
>  vtkRendering.lib    vtk_minimal
>
> Error    5    fatal error LNK1120: 3 unresolved externals
>  Release/../bin/vtk_minimal.exe    vtk_minimal
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>



-- 
François Bertel, PhD  | Kitware Inc. Suite 204
1 (518) 371 3971 x113 | 28 Corporate Drive
                      | Clifton Park NY 12065, USA



More information about the vtkusers mailing list