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

Author Topic: Can't build SFML 1.6 on linux (ubuntu 12.04)  (Read 2114 times)

0 Members and 1 Guest are viewing this topic.

Naufr4g0

  • Full Member
  • ***
  • Posts: 112
    • View Profile
Can't build SFML 1.6 on linux (ubuntu 12.04)
« on: October 31, 2015, 02:25:37 pm »
Hi all!
I'm using CodeBlocks on linux to compile some of my old games on this OS.
Since I won't  install sfml with apt-get command (to avoid conflicts with SFML2), I downloaded the source from the official site and tried to build the library by myself.
Using the 'MAKE' command I get some errors, that you can find on the following log.
Could someone figure out how to solve the issue?
Thanks in advance
Naufr4g0

Code: [Select]
make[1]: ingresso nella directory "/home/davide/libs/SFML-1.6/src/SFML"
make[2]: ingresso nella directory "/home/davide/libs/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]: uscita dalla directory "/home/davide/libs/SFML-1.6/src/SFML/System"
make[2]: ingresso nella directory "/home/davide/libs/SFML-1.6/src/SFML/Window"
g++ -o Linux/VideoModeSupport.o -c Linux/VideoModeSupport.cpp -W -Wall -pedantic -I../../../include -I../../ -O2 -DNDEBUG -fPIC
g++ -o Linux/WindowImplX11.o -c Linux/WindowImplX11.cpp -W -Wall -pedantic -I../../../include -I../../ -O2 -DNDEBUG -fPIC
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]: uscita dalla directory "/home/davide/libs/SFML-1.6/src/SFML/Window"
make[2]: ingresso nella directory "/home/davide/libs/SFML-1.6/src/SFML/Network"
g++ -o Ftp.o -c Ftp.cpp -W -Wall -pedantic -I../../../include -I../../ -O2 -DNDEBUG -fPIC
g++ -o Http.o -c Http.cpp -W -Wall -pedantic -I../../../include -I../../ -O2 -DNDEBUG -fPIC
g++ -o IPAddress.o -c IPAddress.cpp -W -Wall -pedantic -I../../../include -I../../ -O2 -DNDEBUG -fPIC
g++ -o Packet.o -c Packet.cpp -W -Wall -pedantic -I../../../include -I../../ -O2 -DNDEBUG -fPIC
g++ -o SelectorBase.o -c SelectorBase.cpp -W -Wall -pedantic -I../../../include -I../../ -O2 -DNDEBUG -fPIC
g++ -o SocketTCP.o -c SocketTCP.cpp -W -Wall -pedantic -I../../../include -I../../ -O2 -DNDEBUG -fPIC
g++ -o SocketUDP.o -c SocketUDP.cpp -W -Wall -pedantic -I../../../include -I../../ -O2 -DNDEBUG -fPIC
g++ -o Unix/SocketHelper.o -c Unix/SocketHelper.cpp -W -Wall -pedantic -I../../../include -I../../ -O2 -DNDEBUG -fPIC
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]: uscita dalla directory "/home/davide/libs/SFML-1.6/src/SFML/Network"
make[2]: ingresso nella directory "/home/davide/libs/SFML-1.6/src/SFML/Graphics"
g++ -o Color.o -c Color.cpp -W -Wall -pedantic -I../../../include -I../../ -O2 -DNDEBUG -fPIC -I/usr/include/freetype2
g++ -o Drawable.o -c Drawable.cpp -W -Wall -pedantic -I../../../include -I../../ -O2 -DNDEBUG -fPIC -I/usr/include/freetype2
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] Errore 1
make[2]: uscita dalla directory "/home/davide/libs/SFML-1.6/src/SFML/Graphics"
make[1]: *** [sfml-graphics] Errore 2
make[1]: uscita dalla directory "/home/davide/libs/SFML-1.6/src/SFML"
make: *** [sfml] Errore 2

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Can't build SFML 1.6 on linux (ubuntu 12.04)
« Reply #1 on: October 31, 2015, 03:53:09 pm »
This is a mistake in source code, the mentioned file should include <cstdlib>.

But why are you using a prehistoric version of SFML?
Laurent Gomila - SFML developer

Naufr4g0

  • Full Member
  • ***
  • Posts: 112
    • View Profile
Re: Can't build SFML 1.6 on linux (ubuntu 12.04)
« Reply #2 on: October 31, 2015, 04:28:47 pm »
This is a mistake in source code, the mentioned file should include <cstdlib>.
Thanks for reply, Laurent. :)
So I have to add the missing include on the source?

But why are you using a prehistoric version of SFML?

Cause I wrote those games a few years ago! :)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Can't build SFML 1.6 on linux (ubuntu 12.04)
« Reply #3 on: October 31, 2015, 05:04:51 pm »
Quote
So I have to add the missing include on the source?
Or in your own code, before including any SFML header.
Laurent Gomila - SFML developer

 

anything