【问题标题】:RTTI property not found for CPP targets in Haxe NME在 Haxe NME 中找不到 CPP 目标的 RTTI 属性
【发布时间】:2013-04-29 01:34:09
【问题描述】:

我在 haxe nme 中使用 rtti。它在以 flash 为目标时运行良好,但在编译为 cpp 目标时我收到以下错误。

错误 C2039:“__rtti”:不是“Class_obj”的成员

我正在这样做……

public function doSomething(type:Class<Dynamic>):Void {
    var typeInfo:String = untyped type.__rtti;
}

我也试过了……

public function doSomething <T:Infos> (type:Class<T>):Void {
    var typeInfo:String = untyped type.__rtti;
}

我该怎么办?

【问题讨论】:

    标签: c++ types rtti haxe nme


    【解决方案1】:

    让它更宽松! :Dynamic 而不是 :Class&lt;Dynamic&gt;

    public function doSomething(type:Dynamic):Void {
        var typeInfo:String = untyped type.__rtti;
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-01-05
      • 2020-03-04
      • 1970-01-01
      相关资源
      最近更新 更多