以下示例代码使用neko编译和运行,但在尝试编译到windows时返回错误消息:
import haxe.ui.toolkit.core.Toolkit;
import haxe.ui.toolkit.core.Root;
import haxe.ui.toolkit.core.interfaces.IDisplayObject;
import Sys.println;
class Main {
public static function main() {
Toolkit.openFullscreen(function(root:Root) {
});
println('test program has run...');
}
}
我收到的错误消息对我来说毫无意义(还有更多,但似乎在重复):
/src/haxe/ui/toolkit/core/renderers/ItemRenderer.cpp(161):错误C2259:"haxe::ui::toolkit::core::interfaces::IStyleableDisplayObject_delegate_":无法实例化抽象类具有[IMPL=haxe::ui::toolkit::core::renderers::ItemRenderer_obj]由于以下成员:"Void haxe::ui::toolkit::core::interfaces::IDisplayObject_obj::addEventListener(String,Dynamic,hx::Null,hx::Null)":是抽象的具有[T=布尔]include\haxe/ui/toolkit/core/interfaces/IDisplayObject.h(127):请参见"haxe::ui::toolkit::core::interfaces::IDisplayObject_obj::addEventListener"的声明"动态haxe::ui::toolkit::core::interfaces::IDisplayObject_obj::addEventListener_dyn(void)":是抽象的include\haxe/ui/toolkit/core/interfaces/IDisplayObject.h(128):请参见"haxe::ui::toolkit::core::interfaces::IDisplayObject_obj::addEventListener_dyn"的声明"bool haxe::ui::toolkit::core::interfaces::IDisplayObject_obj::dispatchEvent(openfl::_legacy::events::Event)":是抽象的include\haxe/ui/toolkit/core/interfaces/IDisplayObject.h(129):请参见"haxe::ui::toolkit::core::interfaces::IDisplayObject_obj::dispatchEvent"的声明"动态haxe::ui::toolkit::core::interfaces::IDisplayObject_obj::dispatchEvent_dyn(void)":是抽象的include\haxe/ui/toolkit/core/interfaces/IDisplayObject.h(130):请参见"haxe::ui::toolkit::core::interfaces::IDisplayObject_obj::dispatchEvent_dyn"的声明"bool haxe::ui::toolkit::core::interfaces::IDisplayObject_obj::hasEventListener(String)":是抽象的include\haxe/ui/toolkit/core/interfaces/IDisplayObject.h(131):请参见"haxe::ui::toolkit::core::interfaces::IDisplayObject_obj::hasEventListener"的声明"动态haxe::ui::toolkit::core::interfaces::IDisplayObject_obj::hasEventListener_dyn(void)":是抽象的include\haxe/ui/toolkit/core/interfaces/IDisplayObject.h(132):请参见"haxe::ui::toolkit::core::interfaces::IDisplayObject_obj::hasEventListener_dyn"的声明
非常感谢您的帮助。
这是Haxe 3.2.1的一个问题。
如果降级到3.2.0,那么它应该可以工作。