安装DirectX SDK后,编译VTK出错"__RPC__out_xcount_part"


搞了一个晚上终于搞好了。。。。

===============================================================================================================================

情况:

笔记本,想用VTK使用GPU加速体绘制,用TestGPUInfo例子查出There is 0 GPU(s)。。。。晕,

http://vtk.1045678.n5.nabble.com/dashboard-maintainers-To-make-TestGPUInfo-works-properly-td1254242.html#a1254243  中说,

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. 

(网址:http://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/a47e4fe8-7b3f-45fc-83ee-6bd225213eb9/error-c2061-while-compiling-with-windows-7sdk?forum=windowssdk

删除rpcsal.h文件即可,编译通过,没问题。但是不知道会不会留下什么隐患。。。。因为我就是想vtk用DirectX的。。。








评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值