SFML community forums
Help => General => Topic started by: sirGustav on January 31, 2011, 11:41:44 pm
-
I grabbed revision 1783 of the sfml2 from svn, cmake generated a codeblocks/makefile and tried to build it. I had to install libfreetype6-dev, libjpeg8-dev, libopenal-dev, libglew1-5dev and libsndfile1-dev for cmake to generate code::blocks files and libxrandr-dev for it to build(#include <X11/extensions/Xrandr.h> in src/SFML/Window/Linux/VideoModeImpl.cpp). This was easy to solve, but it would be nice to have a list of dependencies(just a hint).
Both shared and not-shared built fine, but I cant get the examples to "run". Static won't build and shared is missing dependencies:
First error when build "window" sample:
../../lib/libsfml-window-s.a(VideoModeImpl.cpp.o): In function `sf::priv::VideoModeImpl::GetDesktopMode()':
VideoModeImpl.cpp:(.text+0xdb): undefined reference to `XRRGetScreenInfo'
VideoModeImpl.cpp:(.text+0xf4): undefined reference to `XRRConfigCurrentConfiguration'
VideoModeImpl.cpp:(.text+0x107): undefined reference to `XRRConfigSizes'
VideoModeImpl.cpp:(.text+0x15d): undefined reference to `XRRFreeScreenConfigInfo'
I get FT_ (freetype if I'm not misstaken) errors from other samples. This looks to me that it's missing to link to some libraries so a wild guess is either that the cmake configuration is bad, something is badly installed on my part or that static is not supported.
The dynamic version builds but won't start:
error while loading shared librarues: libsfml-window.so.2.0: cannot open shared object file: No such file or directory
I guess that the cause is the same, but the dynamic version fails to load since it's missing some dependencies. So anyone got any ideas?
edit: unless there has been a name change in the build I got and the 1783 version of the supplied FindSFML.cmake, it is unable to find sfml-main.lib (because of the missing -s) when requesting the static library.
-
Try running "sudo apt-get build-dep libsfml-dev" in a terminal to make sure you have installed all dependencies. Then try compiling again.
-
didn't help, sorry :(
same error
-
well the static complain because: http://www.sfml-dev.org/forum/viewtopic.php?p=26407#26407
The shared I can't help you with, without further information.
Dependency list can be found here: http://www.sfml-dev.org/tutorials/1.6/start-linux.php at the bottom.
-
error while loading shared librarues: libsfml-window.so.2.0: cannot open shared object file: No such file or directory
Is the path where you installed it in the LD_LIBRARY_PATH environment variable?
unless there has been a name change in the build I got and the 1783 version of the supplied FindSFML.cmake, it is unable to find sfml-main.lib (because of the missing -s) when requesting the static library.
sfml-main is static, there's no dynamic version. And it's for Windows only, by the way.
-
well the static complain because: http://www.sfml-dev.org/forum/viewtopic.php?p=26407#26407
On Linux, external libraries are not included in SFML static libs
Dynamic linking on linux it is.
Just wondering... is this "not including externals" out of choice or force(ie not possible)?
I only do static linking on windows b/c of the ati bug, so I guess this problem is not present on linux.
Dependency list can be found here: http://www.sfml-dev.org/tutorials/1.6/start-linux.php at the bottom.
figures... rtfm, fail on me :/
error while loading shared librarues: libsfml-window.so.2.0: cannot open shared object file: No such file or directory
Is the path where you installed it in the LD_LIBRARY_PATH environment variable?
No it wasn't and I kinda missed the "sudo make install" part too. sorry... rtfm yet again.
unless there has been a name change in the build I got and the 1783 version of the supplied FindSFML.cmake, it is unable to find sfml-main.lib (because of the missing -s) when requesting the static library.
sfml-main is static, there's no dynamic version. And it's for Windows only, by the way.
Sorry for not being clear... this issue was/is on windows. I guess I should have made another thread about it..
Dynamic linking on windows, looks for sfml-main.lib and finds it. Static linking looks for sfml-main-s.lib and doesn't, since it should look for sfml-main. This is, of course, assuming that this is correct:
set(SFML_STATIC_LIBRARIES ON)
find_package(SFML COMPONENTS system window main)
-
Just wondering... is this "not including externals" out of choice or force(ie not possible)?
I only do static linking on windows b/c of the ati bug, so I guess this problem is not present on linux.
This is not a choice. There's no linking step when creating a static library, so linking has to happen in the final application.
I only do static linking on windows b/c of the ati bug, so I guess this problem is not present on linux.
Indeed.
Dynamic linking on windows, looks for sfml-main.lib and finds it. Static linking looks for sfml-main-s.lib and doesn't, since it should look for sfml-main. This is, of course, assuming that this is correct:
I guess that FindSFML.cmake doesn't handle sfml-main properly :)
Thanks for reporting it.
For now, remove main from the list of components and link it manually.
-
For now, remove main from the list of components and link it manually.
I was lazy and just made a copy :)
-
I fixed FindSFML.cmake, "main" should now work fine.