SFML community forums
Help => General => Topic started by: Kalantir on May 25, 2012, 10:45:45 pm
-
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?
-
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
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
error: 'class sf::<class name>' has no member named '<member function name>'
Which classes and functions?
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?
-
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.
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
-
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).
-
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?
-
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.
-
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.