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

Author Topic: Installing SFML on a ubuntu machine  (Read 2647 times)

0 Members and 1 Guest are viewing this topic.

ca11meyoung

  • Newbie
  • *
  • Posts: 2
    • View Profile
Installing SFML on a ubuntu machine
« on: November 28, 2012, 01:39:40 am »
Hello SFML community!

I'm new here and I ran into a problem while trying to install SFML into my Virtual box Unbuntu.

I've been attempting to install SFML(API) into my Virtual Box ubuntu for the last few hours, but I cant seem to find the solution to this error problem. The original problem seemed was a hardware problem it seemed dealing with the fglrx(ati), but I have no clue what this error is nor what it's suppose to mean.

So, after I downdloaded the SFML and extracted it into a folder. Inside the directory in terminal, I follow the instructions on here http://www.sfml-dev.org/tutorials/1.5/start-linux.php.

Once I run "make" it gives me the following error.



make
make[1]: Entering directory `/home/chris/Downloads/SFML-1.6/src/SFML'
make[2]: Entering directory `/home/chris/Downloads/SFML-1.6/src/SFML/System'
g++ -shared -Wl,-soname,libsfml-system.so.1.6 -o ../../../lib/libsfml-system.so.1.6 Clock.o Lock.o Randomizer.o Sleep.o Unicode.o ./Unix/Initializer.o ./Unix/Mutex.o ./Unix/Platform.o ./Unix/Thread.o -lpthread
make[2]: Leaving directory `/home/chris/Downloads/SFML-1.6/src/SFML/System'
make[2]: Entering directory `/home/chris/Downloads/SFML-1.6/src/SFML/Window'
g++ -shared -Wl,-soname,libsfml-window.so.1.6 -o ../../../lib/libsfml-window.so.1.6 Context.o Input.o VideoMode.o Window.o WindowImpl.o ./Linux/Joystick.o ./Linux/VideoModeSupport.o ./Linux/WindowImplX11.o  -lX11 -lXrandr -lGL
make[2]: Leaving directory `/home/chris/Downloads/SFML-1.6/src/SFML/Window'
make[2]: Entering directory `/home/chris/Downloads/SFML-1.6/src/SFML/Network'
g++ -shared -Wl,-soname,libsfml-network.so.1.6 -o ../../../lib/libsfml-network.so.1.6 Ftp.o Http.o IPAddress.o Packet.o SelectorBase.o SocketTCP.o SocketUDP.o ./Unix/SocketHelper.o
make[2]: Leaving directory `/home/chris/Downloads/SFML-1.6/src/SFML/Network'
make[2]: Entering directory `/home/chris/Downloads/SFML-1.6/src/SFML/Graphics'
g++ -o Font.o -c Font.cpp -W -Wall -pedantic -I../../../include -I../../ -O2 -DNDEBUG -fPIC -I/usr/include/freetype2
In file included from ../../../include/SFML/System/Resource.hpp:211:0,
                 from ../../../include/SFML/Graphics/Font.hpp:31,
                 from Font.cpp:28:
../../../include/SFML/System/ResourcePtr.inl: In constructor ‘sf::ResourcePtr< <template-parameter-1-1> >::ResourcePtr()’:
../../../include/SFML/System/ResourcePtr.inl:31:12: error: ‘NULL’ was not declared in this scope
../../../include/SFML/System/ResourcePtr.inl: In member function ‘void sf::ResourcePtr< <template-parameter-1-1> >::OnResourceDestroyed()’:
../../../include/SFML/System/ResourcePtr.inl:148:18: error: ‘NULL’ was not declared in this scope
make[2]: *** [Font.o] Error 1
make[2]: Leaving directory `/home/chris/Downloads/SFML-1.6/src/SFML/Graphics'
make[1]: *** [sfml-graphics] Error 2
make[1]: Leaving directory `/home/chris/Downloads/SFML-1.6/src/SFML'
make: *** [sfml] Error 2

I have no idea what those errors at the bottom are. I tried googling them, but no luck. My only guess is that I might have missed a file when downloading it. Any help would be great. Thanks.

-Chris

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Installing SFML on a ubuntu machine
« Reply #1 on: November 28, 2012, 07:45:06 am »
The source file should include <cstdlib>, it's a mistake in SFML.

But it's soooo old (and unmaintained), use SFML 2 instead.
Laurent Gomila - SFML developer

ca11meyoung

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Installing SFML on a ubuntu machine
« Reply #2 on: November 29, 2012, 08:01:51 am »
Ok since you recommended me to install sfml2. I am now following this tutorial http://sfmlcoder.wordpress.com/2011/08/16/building-sfml-2-0-with-make-for-gcc/ . I installed everything but once I run this code command

Quote
cmake -G "Unix Makefiles" -D CMAKE_BUILD_TYPE=Debug -D BUILD_SHARED_LIBS=TRUE


I then received this error once I tried to run this simple command.

Quote
cmake -G "Unix Makefiles" -D CMAKE_BUILD_TYPE=Debug -D BUILD_SHARED_LIBS=TRUE
CMake Error:
  The path to the source directory:

    /home/chris/Development/sfml2ss/BUILD_SHARED_LIBS=TRUE

  contains unsupported character '='.

  Please use a different source directory name.

Do you have any clue why?

Thanks for all your help.

-Chris





********************************EDIT*****************************************

Simple solution. No spaces inbetween and everything works as intended. I figured I edit for future reference to anyone following that tutorial.

Quote
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=TRUE
« Last Edit: November 29, 2012, 08:08:27 am by ca11meyoung »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Installing SFML on a ubuntu machine
« Reply #3 on: November 29, 2012, 08:08:04 am »
There must be no space between -D and the option name.

And you should rather follow the official tutorial. And don't build debug libraries, you only need the release ones on Linux.

And don't forget that a precompiled release candidate exists.
Laurent Gomila - SFML developer