搞了一个晚上终于搞好了。。。。
===============================================================================================================================
情况:
笔记本,想用VTK使用GPU加速体绘制,用TestGPUInfo例子查出There is 0 GPU(s)。。。。晕,
in order to make TestGPUInfo work properly and return something like:
"
There is 1 GPU(s).
GPU 0:
dedicated VRAM=512 MB
dedicated RAM=0 MB
shared RAM=0 MB
"
instead of
"There is 0 GPU(s)."
1. With a Windows machine, you need to install the DirectX SDK.
It have been tested on VTKEdge with the DirectX SDK from August 2008:
http://www.microsoft.com/downloads/details.aspx?FamilyID=ea4894b5-e98d-44f6-842d-e32147237638&DisplayLang=en
And you can find the latest Direct X SDK from February 2010 here:
http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=2c7da5fb-ffbb-4af6-8c66-651cbd28ca15
===============================================================================================================================
到网上搜了一下,发现,博文http://www.cnblogs.com/qwcbeyond/archive/2011/04/05/2005531.html 说,必须要装directX SDK 才行。于是,到vtk论坛上去搜了一下,下载了个DXSDK_Aug08,安装了。
重新CMake,然后visual 2010 build,发现错误:
1>c:\program files\microsoft sdks\windows\v6.0a\include\objidl.h(11265) : error C2061: Syntaxfehler: Bezeichner '__RPC__out_xcount_part'
1>c:\program files\microsoft sdks\windows\v6.0a\include\objidl.h(11266) : error C2059: Syntaxfehler: ')'
...
晕啊,然后去搜,说是DirectX SDK和Windows SDK冲突,要保证Windows SDK路径在DirectX SDK路径前面,
I think I know what might be causing this problem. If the DirectX SDK was installed after the Windows SDK, the DirectX \include directory will come before the Windows SDK \include directory in your PATH. This means that Visual Studio will be build with the version of objidl.h that ships in the DirectX SDK. You must build with the version of objidl.h that ships in the Windows 7 SDK.
Please look at your VC++ Directory Settings in VS and see if the Windows SDK include path (C:\Program Files\Microsoft SDKs\Windows\v7.0\Include) is at the top of the list. This will make Visual Studio use the SDK resources first. You should also change the settings for the Executable and Library directories, so that the Windows SDK directories are at the top.
To change the directories, in Visual Studio IDE, go to Tools, Options, Projects and Solutions, VC++ Directories.
--Karin
但是vtkRendering这个工程的文件里,包含路径是这样的:
I encountered the same error, except I never installed the DX SDK - I have it as part of my source control checkout. As a result, there is no dx include path - all my directx includes are of the form #include "dx\dx9.h". I've tried to #include <objidl.h> before dx in the precompiled header, but this has no effect. My include paths are as they are from install, the inherited values:
$(VCInstallDir)include
$(VCInstallDir)atlmfc\include
$(WindowsSdkDir)\include
$(FrameworkSDKDir)include
Ideas? I'd really rather not repair an installation I just completed.
根本就没有用DirectX SDK路径!!!
最终的解决办法:
Simply remove rpcsal.h from DX SDK directory.
删除rpcsal.h文件即可,编译通过,没问题。但是不知道会不会留下什么隐患。。。。因为我就是想vtk用DirectX的。。。