jtransc / gdx-backend-jtransc

GDX backend for JTransc: targeting every platform lime supports (html5, windows, linux, mac, android, ios...) (flash is wip) (consoles + unity likely to be supported in the future)
23 stars 6 forks source link

Errors running jtransc for libgdx projects #24

Open fxzjshm opened 7 years ago

fxzjshm commented 7 years ago

Using machine: Ubuntu 16.04 in Hyper-V Virtual Machine on Windows 10 Haxe: 3.4.0

I tried jtransc for my test project fxzjshm/Polyfiter but I got several errors executing these:

$ ./graldew jtransc:runJs

Uncaught TypeError: Cannot read property 'clearColor' of null file:///home/fxzjshm/workspace/Polyfiter/jtransc/build/jtransc-js/program.js 154192 4 {}

This line is

com_jtransc_media_limelibgdx_gl_LimeGL20.prototype["glClearColor(FFFF)V"] = function(p0, p1, p2, p3) {  
    GL.clearColor(p0, p1, p2, p3);  
};

. . . $ ./graldew jtransc:runCpp

src/java_/lang/Thread_State_.cpp 
Error: In file included from ./src/java_/lang/Thread_State_.cpp:38:0:
include/java_/lang/Thread_State_.h:57:26: error: declaration does not declare anything [-fpermissive]
   static  ::java_::lang::Thread_State_ _NEW;

. . $ ./graldew jtransc:runD

* What went wrong:
Execution failed for task ':jtransc:runD'.
com.jtransc.error.InvalidOperationException: Can't find field AstFieldWithoutClassRef(name=tokenImage, type=java.lang.String[]) on ancestors
        at com.jtransc.error.ErrorsKt.invalidOp(errors.kt:37)
        at com.jtransc.error.ErrorsKt.invalidOp$default(errors.kt:37)
        at com.jtransc.ast.AstClass.get(ast.kt:509)
        at com.jtransc.ast.AstClass.get(ast.kt:508)
        at com.jtransc.ast.AstProgram.get(ast.kt:255)
        at com.jtransc.gen.common.CommonGenerator.fixField(CommonGenerator.kt:506)
        at com.jtransc.gen.common.CommonGenerator.genExprFieldStaticAccess(CommonGenerator.kt:843)
        at com.jtransc.gen.common.CommonGenerator.genExpr2(CommonGenerator.kt:307)
        at com.jtransc.gen.common.CommonGenerator.genExpr(CommonGenerator.kt:422)
        at com.jtransc.gen.common.CommonGenerator.genExprCallBase(CommonGenerator.kt:342)
        at com.jtransc.gen.common.CommonGenerator.genExpr2(CommonGenerator.kt:318)
        at com.jtransc.gen.common.CommonGenerator.genExpr(CommonGenerator.kt:422)
        at com.jtransc.gen.common.CommonGenerator.genStmExpr(CommonGenerator.kt:933)
        at com.jtransc.gen.common.CommonGenerator.genStm2(CommonGenerator.kt:276)
        at com.jtransc.gen.common.CommonGenerator.genStm(CommonGenerator.kt:424)
        at com.jtransc.gen.common.CommonGenerator.genStmStms(CommonGenerator.kt:932)
        at com.jtransc.gen.common.CommonGenerator.genStm2(CommonGenerator.kt:277)
        at com.jtransc.gen.common.CommonGenerator.genStm(CommonGenerator.kt:423)
        at com.jtransc.gen.common.CommonGenerator.genBody2(CommonGenerator.kt:539)
        at com.jtransc.gen.common.CommonGenerator.genBody(CommonGenerator.kt:493)
        at com.jtransc.gen.common.CommonGenerator.genBody2WithFeatures(CommonGenerator.kt:500)
        at com.jtransc.gen.common.CommonGenerator.genMethod(CommonGenerator.kt:220)
        at com.jtransc.gen.d.DGenerator.genClassBodyMethods(DTarget.kt:161)
        at com.jtransc.gen.common.CommonGenerator.genClassBody(CommonGenerator.kt:158)
        at com.jtransc.gen.common.CommonGenerator.genClass(CommonGenerator.kt:141)
        at com.jtransc.gen.common.CommonGenerator.genClassesWithoutAppends(CommonGenerator.kt:131)
        at com.jtransc.gen.common.CommonGenerator.genClasses(CommonGenerator.kt:125)
        at com.jtransc.gen.d.DGenerator.genClasses(DTarget.kt:123)
        at com.jtransc.gen.common.SingleFileCommonGenerator.writeProgram(SingleFileCommonGenerator.kt:8)
        at com.jtransc.gen.d.DGenerator.writeProgram(DTarget.kt:109)
        at com.jtransc.gen.common.CommonGenerator.buildSource(CommonGenerator.kt:81)
        at com.jtransc.gen.GenTargetDescriptor.build(gen.kt:90)
        at com.jtransc.JTranscBuild._buildAndRun(build.kt:161)
        at com.jtransc.JTranscBuild.buildAndRunRedirecting(build.kt:85)
        at com.jtransc.gradle.tasks.JTranscGradleRunTask.task(JTranscGradleRunTask.kt:17)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
        ... 75 more

This error appears in C++, JS,C# too.

UPDATE:
$ ./graldew jtransc:runNeko

Error: Field hashing conflict _update__BII_V and __str5621
ERROR (373146) (1)

Could you help me?

ghost commented 7 years ago

@fxzjshm Please, test again version 0.6.5, i think we fix it.

soywiz commented 7 years ago

runJs doesnt use haxe. You can try runHaxeJs too. I will check tomorrow

ghost commented 7 years ago

confirmed broken