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

Author Topic: setting up SFML with Linux doesn't work  (Read 4438 times)

0 Members and 1 Guest are viewing this topic.

aligator

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Email
setting up SFML with Linux doesn't work
« on: May 29, 2013, 05:16:06 pm »
hi

I have Kubuntu 12.10 64bit

I tried this:
http://www.sfml-dev.org/tutorials/2.0/start-linux.php

I downloaded the 32bit version, and unpacked it to /usr/local/

if I try to compile it, I get this:

johannes@johannes-Kubuntu:~/Downloads/SFML$ g++ -c main.cpp
johannes@johannes-Kubuntu:~/Downloads/SFML$ g++ main.o -o sfml-app -lsfml-graphics -lsfml-window -lsfml-system
/usr/bin/ld: Inkompatible /usr/local/lib/libsfml-graphics.so wird übersprungen bei der Suche nach -lsfml-graphics
/usr/bin/ld: cannot find -lsfml-graphics
/usr/bin/ld: Inkompatible /usr/local/lib/libsfml-window.so wird übersprungen bei der Suche nach -lsfml-window
/usr/bin/ld: cannot find -lsfml-window
/usr/bin/ld: Inkompatible /usr/local/lib/libsfml-system.so wird übersprungen bei der Suche nach -lsfml-system
/usr/bin/ld: cannot find -lsfml-system
collect2: Fehler: ld gab 1 als Ende-Status zurück
johannes@johannes-Kubuntu:~/Downloads/SFML$
 


why are the files incompatible?

aligator

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: setting up SFML with Linux doesn't work
« Reply #1 on: May 29, 2013, 07:17:00 pm »
Quote
why are the files incompatible?
Is this what the error says? Sorry I don't speak german.

If you have a 64-bits Linux, you have the 64-bits toolchain by default, and can't compile with 32-bits libraries unless you install stuff and/or change some options.
Laurent Gomila - SFML developer

aligator

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Email
Re: setting up SFML with Linux doesn't work
« Reply #2 on: May 29, 2013, 07:47:51 pm »
OK I will try the 64bit version.

I downloaded 32 bit because here: http://www.sfml-dev.org/download/sfml/2.0/

is written:

Quote
Pre-compiled libraries are provided in both 32 bits and 64 bits versions. Choosing one or the other should be based on which platform you want to compile for, not which OS you have. Indeed, you can perfectly compile and run a 32 bits program on a 64 bits OS. So you'll most likely want to target 32 bits platforms, to have the largest possible audience. Choose 64 bits packages only if you have good reasons.

aligator

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Email
Re: setting up SFML with Linux doesn't work
« Reply #3 on: May 29, 2013, 08:02:25 pm »
ok now I installed x64.

but I can't get it work:

Quote
johannes@johannes-Kubuntu:~/Downloads/SFML$ g++ -c main.cpp
johannes@johannes-Kubuntu:~/Downloads/SFML$ g++ main.o -o sfml-app -lsfml-graphics -lsfml-window -lsfml-system
/usr/bin/ld: warning: libGLEW.so.1.5, needed by /usr/local/lib/libsfml-graphics.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libjpeg.so.62, needed by /usr/local/lib/libsfml-graphics.so, not found (try using -rpath or -rpath-link)
/usr/local/lib/libsfml-graphics.so: undefined reference to `jpeg_finish_compress@LIBJPEG_6.2'
/usr/local/lib/libsfml-graphics.so: undefined reference to `jpeg_write_scanlines@LIBJPEG_6.2'
/usr/local/lib/libsfml-graphics.so: undefined reference to `__glewUniform1fARB'
/usr/local/lib/libsfml-graphics.so: undefined reference to `jpeg_std_error@LIBJPEG_6.2'
/usr/local/lib/libsfml-graphics.so: undefined reference to `__GLEW_ARB_shader_objects'
/usr/local/lib/libsfml-graphics.so: undefined reference to `__glewGetObjectParameterivARB'
/usr/local/lib/libsfml-graphics.so: undefined reference to `__GLEW_ARB_vertex_shader'
/usr/local/lib/libsfml-graphics.so: undefined reference to `__glewFramebufferTexture2DEXT'
/usr/local/lib/libsfml-graphics.so: undefined reference to `__glewUniformMatrix4fvARB'
/usr/local/lib/libsfml-graphics.so: undefined reference to `jpeg_set_quality@LIBJPEG_6.2'
/usr/local/lib/libsfml-graphics.so: undefined reference to `__glewGenFramebuffersEXT'
/usr/local/lib/libsfml-graphics.so: undefined reference to `__glewUniform3fARB'
/usr/local/lib/libsfml-graphics.so: undefined reference to `jpeg_set_defaults@LIBJPEG_6.2'
/usr/local/lib/libsfml-graphics.so: undefined reference to `__glewRenderbufferStorageEXT'
/usr/local/lib/libsfml-graphics.so: undefined reference to `jpeg_CreateCompress@LIBJPEG_6.2'
/usr/local/lib/libsfml-graphics.so: undefined reference to `__GLEW_ARB_fragment_shader'
/usr/local/lib/libsfml-graphics.so: undefined reference to `__glewActiveTextureARB'
/usr/local/lib/libsfml-graphics.so: undefined reference to `jpeg_start_compress@LIBJPEG_6.2'
/usr/local/lib/libsfml-graphics.so: undefined reference to `__glewShaderSourceARB'
/usr/local/lib/libsfml-graphics.so: undefined reference to `glewInit'
/usr/local/lib/libsfml-graphics.so: undefined reference to `__glewBindFramebufferEXT'
/usr/local/lib/libsfml-graphics.so: undefined reference to `__glewFramebufferRenderbufferEXT'
/usr/local/lib/libsfml-graphics.so: undefined reference to `__glewLinkProgramARB'
/usr/local/lib/libsfml-graphics.so: undefined reference to `__glewUseProgramObjectARB'
/usr/local/lib/libsfml-graphics.so: undefined reference to `__glewBlendFuncSeparateEXT'
/usr/local/lib/libsfml-graphics.so: undefined reference to `__glewGenRenderbuffersEXT'
/usr/local/lib/libsfml-graphics.so: undefined reference to `__glewUniform2fARB'
/usr/local/lib/libsfml-graphics.so: undefined reference to `jpeg_destroy_compress@LIBJPEG_6.2'
/usr/local/lib/libsfml-graphics.so: undefined reference to `__glewUniform4fARB'
/usr/local/lib/libsfml-graphics.so: undefined reference to `__glewCreateProgramObjectARB'
/usr/local/lib/libsfml-graphics.so: undefined reference to `glewGetErrorString'
/usr/local/lib/libsfml-graphics.so: undefined reference to `__glewCompileShaderARB'
/usr/local/lib/libsfml-graphics.so: undefined reference to `__glewDeleteRenderbuffersEXT'
/usr/local/lib/libsfml-graphics.so: undefined reference to `__glewDeleteObjectARB'
/usr/local/lib/libsfml-graphics.so: undefined reference to `__glewGetUniformLocationARB'
/usr/local/lib/libsfml-graphics.so: undefined reference to `__glewGetInfoLogARB'
/usr/local/lib/libsfml-graphics.so: undefined reference to `__GLEW_EXT_blend_func_separate'
/usr/local/lib/libsfml-graphics.so: undefined reference to `__glewDeleteFramebuffersEXT'
/usr/local/lib/libsfml-graphics.so: undefined reference to `__glewCheckFramebufferStatusEXT'
/usr/local/lib/libsfml-graphics.so: undefined reference to `__glewUniform1iARB'
/usr/local/lib/libsfml-graphics.so: undefined reference to `__GLEW_ARB_texture_non_power_of_two'
/usr/local/lib/libsfml-graphics.so: undefined reference to `jpeg_stdio_dest@LIBJPEG_6.2'
/usr/local/lib/libsfml-graphics.so: undefined reference to `__GLEW_ARB_shading_language_100'
/usr/local/lib/libsfml-graphics.so: undefined reference to `__glewCreateShaderObjectARB'
/usr/local/lib/libsfml-graphics.so: undefined reference to `__glewBindRenderbufferEXT'
/usr/local/lib/libsfml-graphics.so: undefined reference to `__GLEW_EXT_framebuffer_object'
/usr/local/lib/libsfml-graphics.so: undefined reference to `__glewAttachObjectARB'
/usr/local/lib/libsfml-graphics.so: undefined reference to `__glewGetHandleARB'
collect2: Fehler: ld gab 1 als Ende-Status zurück

what does this mean?
What is libGLEW.so.1.5 and libjpeg.so.62 ?
« Last Edit: May 29, 2013, 08:11:43 pm by aligator »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: setting up SFML with Linux doesn't work
« Reply #4 on: May 29, 2013, 08:12:11 pm »
I will change the website message, things are different for Linux.

Your problem is that your libraries and the ones that SFML was compiled with are different (different versions). You should recompile SFML to avoid such troubles. Things will get much easier when SFML 2 is in the official repositories :-\
Laurent Gomila - SFML developer

aligator

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Email
Re: setting up SFML with Linux doesn't work
« Reply #5 on: May 29, 2013, 08:16:19 pm »
OK I try that.

edit:

I use cmake qt-gui and I get this:

CMake Error at CMakeLists.txt:3 (include):
  include could not find load file:

    /home/johannes/Downloads/SFML/SFML-master/SFML-master/src/SFML/cmake/Macros.cmake


CMake Error at System/CMakeLists.txt:81 (sfml_add_library):
  Unknown CMake command "sfml_add_library".


CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 2.8)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Error: You have requested backwards compatibility with CMake version 1.2 or earlier. This version of CMake only supports backwards compatibility with CMake 1.4 or later. For compatibility with 1.2 or earlier please use CMake 2.0
CMake Error: You have requested backwards compatibility with CMake version 1.2 or earlier. This version of CMake only supports backwards compatibility with CMake 1.4 or later. For compatibility with 1.2 or earlier please use CMake 2.0
Configuring incomplete, errors occurred!

And I can't find CMake 2.0 in the repositories of Kubuntu...

edit2: when will SFML be in the repositories?

edit3:

now I added cmake_minimum_required(VERSION 2.0) to CMakeLists.txt
this works. but the two errors:
CMake Error at CMakeLists.txt:3 (include):
  include could not find load file:

    /home/johannes/Downloads/SFML/SFML-master/SFML-master/src/SFML/cmake/Macros.cmake


CMake Error at System/CMakeLists.txt:81 (sfml_add_library):
  Unknown CMake command "sfml_add_library".
 

are still there
« Last Edit: May 29, 2013, 09:11:10 pm by aligator »

aligator

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Email
Re: setting up SFML with Linux doesn't work
« Reply #6 on: June 03, 2013, 04:44:40 pm »
I still have no working solution...  :(

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: setting up SFML with Linux doesn't work
« Reply #7 on: June 03, 2013, 04:51:25 pm »
What "source directory" do you use in cmake-gui? It must be the root of the SFML folder, the one which contains /include, /src, etc.
Laurent Gomila - SFML developer

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: setting up SFML with Linux doesn't work
« Reply #8 on: June 03, 2013, 04:53:42 pm »
Quote
when will SFML be in the repositories?
When the people who maintain the libsfml-dev packages do it. You can contact them if you want more precise answers.
Laurent Gomila - SFML developer

aligator

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Email
Re: setting up SFML with Linux doesn't work
« Reply #9 on: June 03, 2013, 05:28:01 pm »
I used
/home/johannes/Downloads/SFML/SFML-master/src/SFML

if I use /home/johannes/Downloads/SFML/SFML-master it works!

after I compiled it, I get the .so files (everything, which I must put into /usr/local/lib)
but which files must I put into /usr/local/include and /usr/local/share?

edit: or can I use the Include and share folder of the Linux SFML-download?
« Last Edit: June 03, 2013, 05:30:49 pm by aligator »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: setting up SFML with Linux doesn't work
« Reply #10 on: June 03, 2013, 07:34:18 pm »
Run "make install", and everything will be installed correctly.

PS: all these answers (including the first one) are in the tutorial.
Laurent Gomila - SFML developer

aligator

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Email
Re: setting up SFML with Linux doesn't work
« Reply #11 on: June 03, 2013, 11:42:12 pm »
OK now it is working thank you!

 

anything