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

Author Topic: make sfml in linux, ubuntu  (Read 4829 times)

0 Members and 1 Guest are viewing this topic.

csiz

  • Newbie
  • *
  • Posts: 30
    • Yahoo Instant Messenger - calinutzu92
    • View Profile
    • Email
make sfml in linux, ubuntu
« on: June 05, 2009, 01:26:26 pm »
When make ing sfml from the src, because I want those static libraries, I got this output in the console (wich I don't really understand)

Code: [Select]
csiz@csiz-desktop:~/Desktop/C++/SFML-1.5/src/SFML$ make sfml-window
make[1]: Entering directory `/media/Everything/Info/C++/SFML-1.5/src/SFML/Window'
g++ -o Linux/VideoModeSupport.o -c Linux/VideoModeSupport.cpp -W -Wall -pedantic -I../../../include -I../../ -O2 -DNDEBUG
Linux/VideoModeSupport.cpp:31:35: error: X11/extensions/Xrandr.h: No such file or directory
Linux/VideoModeSupport.cpp: In static member function ‘static void sf::priv::VideoModeSupport::GetSupportedVideoModes(std::vector<sf::VideoMode, std::allocator<sf::VideoMode> >&)’:
Linux/VideoModeSupport.cpp:58: error: ‘XRRScreenConfiguration’ was not declared in this scope
Linux/VideoModeSupport.cpp:58: error: ‘Config’ was not declared in this scope
Linux/VideoModeSupport.cpp:58: error: ‘XRRGetScreenInfo’ was not declared in this scope
Linux/VideoModeSupport.cpp:63: error: ‘XRRScreenSize’ was not declared in this scope
Linux/VideoModeSupport.cpp:63: error: ‘Sizes’ was not declared in this scope
Linux/VideoModeSupport.cpp:63: error: ‘XRRConfigSizes’ was not declared in this scope
Linux/VideoModeSupport.cpp:88: error: ‘XRRFreeScreenConfigInfo’ was not declared in this scope
Linux/VideoModeSupport.cpp: In static member function ‘static sf::VideoMode sf::priv::VideoModeSupport::GetDesktopVideoMode()’:
Linux/VideoModeSupport.cpp:121: error: ‘XRRScreenConfiguration’ was not declared in this scope
Linux/VideoModeSupport.cpp:121: error: ‘Config’ was not declared in this scope
Linux/VideoModeSupport.cpp:121: error: ‘XRRGetScreenInfo’ was not declared in this scope
Linux/VideoModeSupport.cpp:125: error: ‘Rotation’ was not declared in this scope
Linux/VideoModeSupport.cpp:125: error: expected `;' before ‘CurrentRotation’
Linux/VideoModeSupport.cpp:126: error: ‘CurrentRotation’ was not declared in this scope
Linux/VideoModeSupport.cpp:126: error: ‘XRRConfigCurrentConfiguration’ was not declared in this scope
Linux/VideoModeSupport.cpp:130: error: ‘XRRScreenSize’ was not declared in this scope
Linux/VideoModeSupport.cpp:130: error: ‘Sizes’ was not declared in this scope
Linux/VideoModeSupport.cpp:130: error: ‘XRRConfigSizes’ was not declared in this scope
Linux/VideoModeSupport.cpp:135: error: ‘XRRFreeScreenConfigInfo’ was not declared in this scope
make[1]: *** [Linux/VideoModeSupport.o] Error 1
make[1]: Leaving directory `/media/Everything/Info/C++/SFML-1.5/src/SFML/Window'
make: *** [sfml-window] Error 2


ps could you include static libs in the download?:D
My new webpage calinmocanu

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
make sfml in linux, ubuntu
« Reply #1 on: June 05, 2009, 01:53:20 pm »
You have to install the development files for XrandR (libxrandr-dev).
You'll probably have to install other packages.

Quote
ps could you include static libs in the download?

No I won't, static build on Linux is bad.
Laurent Gomila - SFML developer

csiz

  • Newbie
  • *
  • Posts: 30
    • Yahoo Instant Messenger - calinutzu92
    • View Profile
    • Email
make sfml in linux, ubuntu
« Reply #2 on: June 05, 2009, 02:03:06 pm »
why is it bad? and if there are no static libs can i put the .so libs in the same folder as the binary (as in windows) or do I have to tell everyone to install sfml? (the non developers...)
My new webpage calinmocanu

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
make sfml in linux, ubuntu
« Reply #3 on: June 05, 2009, 02:19:59 pm »
It is bad because Linux manages libraries much better than Windows, and prefers shared libraries to static ones.

It is bad also because you can't include a library into a static one, so to compile your program you would have to link against the SFML libraries plus all the external libraries it is using (xlib, xrandr, freetype, openal, libsndfile, ...).

I guess you can put the binaries together with the executable (never tried), but the best solution is to make a package that will install properly both your game and all the external libraries.
But please don't ask me how to do this :lol:
Laurent Gomila - SFML developer

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
make sfml in linux, ubuntu
« Reply #4 on: June 05, 2009, 02:40:04 pm »
I don't think you're able to put the so files and the application in the same directory. The OS won't look in the current directory for .so, but in /usr/lib/ and some others paths. ( There is a variable you can change in your profile to do want you want, but I don't know its name and it's awful. )

If you want to build some package I wrote something about : http://hiura.tuxfamily.org/wiki/doku.php?id=other:project:deb:deb . It may help you ( or not ) .  :wink:
SFML / OS X developer

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
make sfml in linux, ubuntu
« Reply #5 on: June 05, 2009, 04:05:49 pm »
I think you can change the install path in order to make it relative to the executable. That's what I do with Mac OS X. But... the option used to do that only exists for Darwin (ie. Mac OS X kernel) : -install_name. I dunno whether you can find something similar on Linux.
Want to play movies in your SFML application? Check out sfeMovie!

remi.k2620

  • Full Member
  • ***
  • Posts: 186
    • View Profile
    • http://remi.tuxfamily.org
make sfml in linux, ubuntu
« Reply #6 on: June 05, 2009, 08:07:16 pm »
You just need to do export LD_LIBRARY_PATH=your_path_to_so_files/

 

anything