[英]Renderscript not working for Adt bundle
I'm using the Android ADT bundle on Ubuntu 12.04 and I'm trying to write an app that uses RenderScript. 我正在Ubuntu 12.04上使用Android ADT捆绑包,并且试图编写一个使用RenderScript的应用程序。
I've placed a .rs file in the package folder and it looks as follows: 我在包文件夹中放置了一个.rs文件,它看起来如下:
#pragma version(1)
#pragma rs java_package_name(com.example.test)
void root(const uchar4 *in, uchar4 *out, uint32_t x, uint32_t y){
out->r = rsRand(255);
out->g = rsRand(255);
out->b = rsRand(255);
}
However I'm getting the following errors: 但是我遇到以下错误:
error: Compute kernel root() targeting SDK levels 11-13 may not skip (on line 4)
error: missing "#pragma rs java_package_name(com.foo.bar)" in source file (on line 10)
error: missing pragma for version in source file (on line 10)
Can anybody please help me figure out this problem? 有人可以帮我解决这个问题吗?
I had the same problem when trying to build the HelloCompute renderscript example. 尝试构建HelloCompute渲染脚本示例时,我遇到了同样的问题。 I use Eclipse, and after examining the error messages in the Problems window, I noted that they dealt with version numbers.
我使用Eclipse,在检查“问题”窗口中的错误消息后,我注意到它们处理的是版本号。 So I changed the version numbers in the project.properties file as follows:
因此,我更改了project.properties文件中的版本号,如下所示:
target=android-20
renderscript.target=20
renderscript.support.mode=true
sdk.buildtools=20
After this, the pragma errors went away and the project built successfully. 此后,杂用错误消失了,项目成功建立。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.