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

Author Topic: I switched to Linux and now SFML 2.0 doesn't appear to work  (Read 2318 times)

0 Members and 2 Guests are viewing this topic.

Kalantir

  • Newbie
  • *
  • Posts: 7
    • View Profile
Previous OS:  Windows 7
New OS: Kubuntu 12.04 (fully updated)

So, I have a project I was working on awhile ago using SFML 2.0 and it had no problems.  Recently I decided to start working on that project again, but I have since switched operating systems.  I downloaded the latest linux sources and compiled SFML 2.0 using CMake and I have all the dependencies installed.

BUILD_SHARED_LIBS - Yes
CMAKE_BUILD_TYPE - (I did both)
CMAKE_CODEBLOCKS_EXECUTABLE - /usr/bin/codeblocks
CMAKE_INSTALL_PREFIX - /usr/local
GLEW_INCLUDE_PATH - /usr/include
GLEW_LIBRARY - /usr/lib/i386-linux-gnu/libGLEW.so
SFML_BUILD_DOC - no
SFML_BUILD_EXAMPLES - no
SFML_INSTALL_PKGCONFIG_FILES - yes  (could someone clarify what this does exactly?)

I managed to compile the libraries with no problems whatsoever in Code::Blocks

This is where it starts getting confusing to me.

I have .so, .so.2, and .so.2.0 files for everything.  Could someone explain to me what the difference is between each of these and whether I need all of them?  I was only expecting it to produce .so files.

Anyways, I went into my Code::Blocks project settings and configured it, telling it where the include and lib folders were.  I am linking to opengl32 and glu32 properly.  I am also linking to sfml-graphics, sfml-window, and sfml-system (those were the only ones I needed on Windows anyways... I don't see why it'd be different on Linux)

When I try to compile, I get tons of errors that read like this
error: 'class sf::<class name>' has no member named '<member function name>'

I assumed that you had changed the function names(2.0 is still in development after all), but when I looked into it, I found that this is not the case.  Not only does the Code::Blocks autocomplete know those member functions exist, but I even looked in the SFML header files to make sure.  All the member functions I am trying to use definitely exist.

Any ideas on what I'm doing wrong?
« Last Edit: May 26, 2012, 02:14:47 am by Kalantir »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: I switched to Linux and now SFML 2.0 doesn't appear to work
« Reply #1 on: May 26, 2012, 08:02:56 am »
Quote
SFML_INSTALL_PKGCONFIG_FILES - yes  (could someone clarify what this does exactly?)
It is explained in the tutorial. If you don't know what pkg-config is, Google it :P

Quote
I have .so, .so.2, and .so.2.0 files for everything.  Could someone explain to me what the difference is between each of these and whether I need all of them?  I was only expecting it to produce .so files.
http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html

Quote
error: 'class sf::<class name>' has no member named '<member function name>'
Which classes and functions?

Quote
Any ideas on what I'm doing wrong?
Which version/revision of SFML 2 are you using? Do you have another version of SFML installed?
Laurent Gomila - SFML developer

Kalantir

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: I switched to Linux and now SFML 2.0 doesn't appear to work
« Reply #2 on: May 26, 2012, 05:58:12 pm »
Which classes and functions?
error: ‘class sf::Window’ has no member named ‘GetWidth’
error: ‘class sf::Window’ has no member named ‘GetHeight’
error: ‘class sf::Clock’ has no member named ‘Reset’

If I were to comment out those lines, it would complain about another 15 or so(different functions and classes) in the next file.

Quote
Which version/revision of SFML 2 are you using? Do you have another version of SFML installed?
LaurentGomila-SFML-2.0-rc-24-gac9bda5

I don't know what you mean by "installed".  I have the version of SFML 2.0 that I compiled in windows sitting in the same Programming/Libraries/ folder (different subfolder), but there's no reason that should effect anything
« Last Edit: May 26, 2012, 06:12:30 pm by Kalantir »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: I switched to Linux and now SFML 2.0 doesn't appear to work
« Reply #3 on: May 26, 2012, 06:26:38 pm »
Quote
error: ‘class sf::Window’ has no member named ‘GetWidth’
error: ‘class sf::Window’ has no member named ‘GetHeight’
error: ‘class sf::Clock’ has no member named ‘Reset’
These functions are from SFML 1.6 and don't exist anymore in SFML 2.

Basically, all functions are gone because SFML 2 uses a different naming convention (lowerCamelCase).
Laurent Gomila - SFML developer

Kalantir

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: I switched to Linux and now SFML 2.0 doesn't appear to work
« Reply #4 on: May 26, 2012, 06:34:24 pm »
Basically, all functions are gone because SFML 2 uses a different naming convention (lowerCamelCase).

Is this a recent change?  I'm just confused because I found GetWidth on line 176 and GetHeight on line 189 in Windows.hpp

Also, I've only ever used 2.0 (never 1.6) and this compiled just fine in Windows.

Is there somewhere where you have a list of old function names and what the new equivalent is?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: I switched to Linux and now SFML 2.0 doesn't appear to work
« Reply #5 on: May 26, 2012, 07:18:23 pm »
This change was made a few months ago.

The new names are the same, except that the first character is now lower-case. For the real changes, you have the API documentation.
Laurent Gomila - SFML developer

Kalantir

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: I switched to Linux and now SFML 2.0 doesn't appear to work
« Reply #6 on: May 28, 2012, 09:00:57 pm »
Thanks!  I was still having problems even after changing the function names, but the problem resolved itself when I just created a new project and imported my source files in and started over.  I think the problem is that I was using an old project file that was on my Windows install.