[vtkusers] VTK Compile DirectX and GPU

Alex Southern mrapsouthern at gmail.com
Mon Jun 7 10:53:57 EDT 2010


Yipee,

Thanks for this, solved the problem immediately.

For future reference, and to clarify, I created a new folder and copied 
the source files for the example project into it. I then created a 
CMakeLists.txt file a copied the code from Francois's post. I opened 
CMake and set the source folder to the one I created. I then set the 
build path to a 'build' folder within the source folder. Clicked 
configure and accepted the request to create a new folder 'build'. 
Finally I clicked generate, go to the build folder and open the VS 
solution (in this case myProject) then clicked Build->Build Solution 
click Run and navigate to myProgram.exe if prompted.

Thanks again Francois

BR
Alex


On 7.6.2010 17:25, Francois Bertel wrote:
> 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
>>
>>      
>
>
>    




More information about the vtkusers mailing list