2013-12-15 44 views
2

我按照http://www.thesecretpie.com/2011/05/being-like-minecraft-or-how-to-run-your.htmlMac OS X上的libGDX小程序無法加載libgdx.dylib

使用Mac OS X,山獅,雙方Firefox和Safari,我得到這個:

This occurred while 'Switching applet' 
Couldn't load shared library 'libgdx.dylib' for target: Mac OS X, 32-bit 
com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load shared library 'libgdx.dylib' for target: Mac OS X, 32-bit 
    at com.badlogic.gdx.utils.SharedLibraryLoader.load(SharedLibraryLoader.java:110) 
    at com.badlogic.gdx.utils.GdxNativesLoader.load(GdxNativesLoader.java:34) 
........ 
........ 
........ 
Caused by: com.badlogic.gdx.utils.GdxRuntimeException: Unable to read file for extraction: libgdx.dylib 
    at com.badlogic.gdx.utils.SharedLibraryLoader.readFile(SharedLibraryLoader.java:119) 
    at com.badlogic.gdx.utils.SharedLibraryLoader.loadFile(SharedLibraryLoader.java:231) 

此外,我還得到了一些明顯的相關消息。我不知道如果這些相關:

Missing Application-Name: manifest attribute for: http://example.com/applet/lwjgl_util_applet.jar 
Missing Permissions manifest attribute for: http://example.com/applet/lwjgl_util_applet.jar 
Missing Codebase manifest attribute for: http://example.com/applet/lwjgl_util_applet.jar 
Missing Application-Name: manifest attribute for: http://example.com/applet/lwjgl_util_applet.jar 
Missing Permissions manifest attribute for: http://example.com/applet/lwjgl_util_applet.jar 
Missing Codebase manifest attribute for: http://example.com/lwjgl_util_applet.jar 

更新Java不很要麼解決這個問題。

現在,然後,我發現這個問題:libgdx throws exception on Mac, couldn't load shared library libgdx-controllers-desktop.dylib這似乎解決了我幾乎相同的問題。然而,該解決方案是

我忘記拿在GDX-控制器 - 桌面natives.jar。

我抓住了這樣的文件,並把它放在我的/applet文件夾,還去了index.html文件並將gdx-controllers-desktop-natives.jar添加到al_jars屬性,但它不起作用。

在將其導出到Eclipse之前,我還將gdx-controllers-desktop-natives.jar作爲外部JAR添加到了我的項目中,但仍然沒有運氣。

所以我想他們的解決方案不適合我。什麼可能導致這個問題?

+0

是否使用JWS/JNLP部署小程序? –

回答

0

錯誤

Couldn't load shared library 'libgdx.dylib' for target: Mac OS X, 32-bit 

指Libgdx Java代碼無法找到它需要爲當前平臺(它認爲是「Mac OS X中,32位」)的Libgdx本地代碼。

清單問題與此問題無關(因爲這些問題與LWJGL層有關,而不是Libgdx)。

您鏈接的問題是非常相似的,除了你缺少本地庫爲核心Libgdx庫,那問題是關於對Libgdx控制器庫(該Libgdx擴展的一個丟失的本地庫)。您需要確保applet中包含核心libgdx natives .jar。具體而言,您需要確保包含applet中包含文件「libgdx.dylib」的.jar文件。