我正在尝试从本页获取Dart原生扩展示例。如何让Dart原生扩展演示“sample_extension”正常工作?
http://www.dartlang.org/articles/native-extensions-for-standalone-dart-vm/
我在Windows上。我下载并提取镖到C:\ Program Files文件\镖
我检查了dartsSVN到C:\项目\ dartSVN这样我就可以得到sample_extention项目 但是当我打开它的分析器抛出这些问题:
"Target of URI does not exist: 'dart-ext:sample_extension'"
和
"Native functions can only be declared in the SDK and code that is loaded through native extensions"
,当我尝试运行它,我得到
"cannot find extension library 'file:///C:/Projects/Dart/sample_extension/bin/sample_synchronous_extension.dart': Error: line 7 pos 1: library handler failed import 'dart-ext:sample_extension';
'file:///C:/Projects/Dart/sample_extension/bin/test_sample_synchronous_extension.dart': Error: line 7 pos 1: library handler failed import 'sample_synchronous_extension.dart';"
我在做什么错?
谢谢你的帮助!因为即时通讯新我不能单击向上箭头:/ :) – 2013-05-10 14:33:58
做到了“将DLL复制到正确的目录,相对于扩展Dart库部分” 我会认为正确的目录是bin文件夹,其中我有我的.dart文件。 ( – 2013-05-10 15:27:04
@ user1176557'bin'文件夹对我来说是OK的(使用编辑器向导创建的“命令行应用程序”和选中“生成示例内容”选项) – 2013-05-10 19:02:29