Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing a third-party library with libgdx and GWT
    text
    copied!<p>As I'm sure many others have, I've written my own game engine and am successfully using it with libgdx in my desktop project.</p> <p>Now, it's time for me to get the HTML5 project working. I followed <a href="http://siondream.com/blog/games/libraries-libgdx-and-gwt-survival-guide/" rel="nofollow">these directions</a> to integrate my game engine, the "third-party library", into the HTML5 project. However, it hasn't gone smoothly. When I do GWT Compile, I get the following:</p> <pre><code>[ERROR] Errors in 'file:/C:/Data/Development/Java/mygame/src/com/me/mygame/MyGameFoo.java' [ERROR] Line 1329: The method bar(EngineObject) in the type Foo is not applicable for the arguments (GameObjectA) [ERROR] Line 1333: The method bar(EngineObject) in the type Foo is not applicable for the arguments (GameObjectB) [ERROR] Line 1340: The method bar(EngineObject) in the type Foo is not applicable for the arguments (GameObjectB) [ERROR] Errors in 'file:/C:/Data/Development/Java/mygame/src/com/me/mygame/MyGameBar.java' [ERROR] Line 3: The import com.me.engine cannot be resolved [ERROR] Line 7: EngineObject cannot be resolved to a type (and so on...) </code></pre> <p>Both GameObjectA and GameObjectB extend EngineObject, so obviously I'm quite confused by this output.</p> <p>Foo is a class in the engine, so the bottom two errors don't make any sense either. <strong>How can it find com.me.engine.Foo.bar(EngineObject) in the first few errors but not be able to find com.me.engine in the last two errors?</strong> (And remember, this all works in the desktop project!)</p> <p><strong>The only conclusion I can make is that my project setup or GwtDefinition.gwt.xml is incorrect.</strong> I'm stumped as to where I've gone wrong though- any advice is greatly appreciated.</p> <p>GwtDefinition.gwt.xml:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit trunk//EN" "http://google-web-toolkit.googlecode.com/svn/trunk/distro-source/core/src/gwt-module.dtd"&gt; &lt;module&gt; &lt;inherits name='com.badlogic.gdx.backends.gdx_backends_gwt' /&gt; &lt;inherits name='com.badlogic.gdx.controllers' /&gt; &lt;inherits name='com.badlogic.gdx.controllers.controllers-gwt' /&gt; &lt;inherits name='Engine' /&gt; &lt;inherits name='MyGame' /&gt; &lt;entry-point class='com.me.mygame.client.GwtLauncher' /&gt; &lt;set-configuration-property name="gdx.assetpath" value="../mygame-desktop/resources" /&gt; &lt;/module&gt; </code></pre> <p>I thought the "inherits name='Engine'" line was all I needed? Without it, I get a bunch of "No source code is available" errors, so I know I'm doing something right. (It also proves that it's finding the Engine's source!)</p> <p>(Using JRE7)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload