Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: I cannot run a JSFML application (UnsatisfiedLinkError)  (Read 8874 times)

0 Members and 2 Guests are viewing this topic.

Marc15

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
I cannot run a JSFML application (UnsatisfiedLinkError)
« on: May 16, 2013, 07:30:06 am »
Hi,

I decided to try JSMFL. I use Ubuntu 13.04, Eclipse, and of course Java. All of them are 64 bits.

I created a project in Eclipse and I added jsfml.jar in the classpath.

I copied the following code from the tutorial.

package ca.USERNAME.sandbox.jsfml;

import org.jsfml.graphics.Color;
import org.jsfml.graphics.RenderWindow;
import org.jsfml.window.VideoMode;
import org.jsfml.window.event.Event;

public class JSFMLTest {

        /**
         * @param args
         */

        public static void main(String[] args) {
                System.out.println("JSFMLTest");
               
                RenderWindow window = new RenderWindow();
                window.create(new VideoMode(640, 480), "Hello JSFML!");
               
                window.setFramerateLimit(30);
               
                while (window.isOpen()) {
                        window.clear(Color.RED);
                       
                        window.display();
                       
                        for (Event event : window.pollEvents()) {
                                if (event.type == Event.Type.CLOSED) {
                                        window.close();
                                }
                        }
                }
        }

}
 

Eclipse doesn't report any error, except when I run the code. This happens :

JSFMLTest
Exception in thread "main" java.lang.UnsatisfiedLinkError: /home/USERNAME/.jsfml/linux_x64/libsfml-graphics.so: libGLEW.so.1.6: cannot open shared object file: No such file or directory
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1935)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1860)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1821)
        at java.lang.Runtime.load0(Runtime.java:792)
        at java.lang.System.load(System.java:1059)
        at org.jsfml.internal.SFMLNative.loadNativeLibraries(Unknown Source)
        at org.jsfml.internal.SFMLNativeObject.<init>(Unknown Source)
        at org.jsfml.window.Window.<init>(Unknown Source)
        at org.jsfml.graphics.RenderWindow.<init>(Unknown Source)
        at ca.mfcochauxlaberge.sandbox.jsfml.JSFMLTest.main(JSFMLTest.java:16)
 

The .jsfml folder does exist in my user directory. According to my package manager, libGLEW 1.9 is installed. Could this be the problem? It needs 1.6? If I remember correctly, I read in another post that libGLEW is already inside jsfml.jar, so I don't know what to do.

When I run the test application, I get the exact same error.

Thanks for you help.
« Last Edit: May 16, 2013, 03:56:54 pm by Marc15 »

pdinklag

  • Sr. Member
  • ****
  • Posts: 330
  • JSFML Developer
    • View Profile
    • JSFML Website
Re: I cannot run a JSFML application (UnsatisfiedLinkError)
« Reply #1 on: May 19, 2013, 03:53:33 pm »
Hm, this is awkward, because libGLEW should be linked statically into JSFML and not even be a dependency. I chose to do it that way so it's no problem if people got a "wrong" version of GLEW like you do. So there's nothing wrong about your setup, it should be working.

May I ask which version you are using? Is it test release #2? Maybe I did a mistake packaging it up.
JSFML - The Java binding to SFML.

Marc15

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Re: I cannot run a JSFML application (UnsatisfiedLinkError)
« Reply #2 on: May 21, 2013, 01:21:19 am »
Yes, I'm using the second release.

I had to reinstall my computer and this time, I chose Fedora with Xfce instead of Ubuntu. I decided to give it another try, but I got the exact same error.

pdinklag

  • Sr. Member
  • ****
  • Posts: 330
  • JSFML Developer
    • View Profile
    • JSFML Website
Re: I cannot run a JSFML application (UnsatisfiedLinkError)
« Reply #3 on: May 21, 2013, 07:34:39 am »
I just had a look at the binaries in there. Indeed, it looks like libGLEW is not statically linked, so it won't work.
I'll build a new package later and post it here, however, for a 3rd test release I'll need a Mac version. Gonna take care of that.

Thanks for reporting and sorry for the inconvenience.
JSFML - The Java binding to SFML.

Marc15

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Re: I cannot run a JSFML application (UnsatisfiedLinkError)
« Reply #4 on: May 22, 2013, 01:03:21 am »
No problem.

Thanks a lot for the good work.

Syndog

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: I cannot run a JSFML application (UnsatisfiedLinkError)
« Reply #5 on: June 08, 2013, 04:03:06 am »
Hey guys, I just ran into this same problem running JSFML on Linux as well.  Did you manage to get the fixed version in place?  The latest link I see on the download page is dated January 2013...

Thanks!   ;D

« Last Edit: June 08, 2013, 04:06:04 am by Syndog »
Your Kung Fu is no match for my Feng Shui!

Sonkun

  • Full Member
  • ***
  • Posts: 241
    • View Profile
Re: I cannot run a JSFML application (UnsatisfiedLinkError)
« Reply #6 on: June 13, 2013, 10:34:03 pm »
I'm fixing them (https://github.com/Sonkun/JSFML). Once I'm done, I'll pull request my changes :)

Edit: Ubuntu and Fedora packages will follow.
Interested in using SFML with Python ? Try out its Python binding!

pdinklag

  • Sr. Member
  • ****
  • Posts: 330
  • JSFML Developer
    • View Profile
    • JSFML Website
Re: I cannot run a JSFML application (UnsatisfiedLinkError)
« Reply #7 on: June 16, 2013, 06:28:24 pm »
Sorry for the huge delay, I packed up another test release which includes the performance updates from earlier this year and a statically linked libglew that should fix the issue at hand.
JSFML - The Java binding to SFML.

Syndog

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: I cannot run a JSFML application (UnsatisfiedLinkError)
« Reply #8 on: June 16, 2013, 11:52:25 pm »
Thank you for the update!   8)

D.
Your Kung Fu is no match for my Feng Shui!

 

anything