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

Author Topic: Compilation SFML 1.6 [GCC 4.6.0]  (Read 2118 times)

0 Members and 1 Guest are viewing this topic.

riddle

  • Newbie
  • *
  • Posts: 2
    • View Profile
Compilation SFML 1.6 [GCC 4.6.0]
« on: May 11, 2011, 12:58:23 am »
Hi, I cant find fedora rpm package with sfml 1.6 so I decided to compile it on my own. I tried compile source code linked on sfml site but I got strange error. I didn't give up and I cloned git repository, switch to 1.6 branch.. and then.. get the same problem.

Code: [Select]
g++ -o PostFX.o -c PostFX.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/Image.hpp:31,
                 from ../../../include/SFML/Graphics/PostFX.hpp:32,
                 from PostFX.cpp:29:
../../../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


2.0 compile clean but I want to use 1.6 :(

32 bit, Fedora 15 Beta, GCC 4.6.0.
(it's not a problem of beta version of fedora, I found a bug report for ubuntu as well)

Any idea how to deal with it?

---
I've used gcc3.4, sfml compiled ;)
But this is not the way I want work.. Still need help.

OniLinkPlus

  • Hero Member
  • *****
  • Posts: 500
    • View Profile
Compilation SFML 1.6 [GCC 4.6.0]
« Reply #1 on: May 11, 2011, 06:11:58 am »
You have to include cstddef in GCC 4.6 to get NULL, if I remember correctly.
I use the latest build of SFML2

riddle

  • Newbie
  • *
  • Posts: 2
    • View Profile
Compilation SFML 1.6 [GCC 4.6.0]
« Reply #2 on: May 11, 2011, 02:00:49 pm »
I feel so stupid now :D
Thanks a lot.

GWOK20

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Compilation SFML 1.6 [GCC 4.6.0]
« Reply #3 on: June 11, 2012, 04:03:11 pm »
Please explain me how do you do that.

Thanks.

GWOK20

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Compilation SFML 1.6 [GCC 4.6.0]
« Reply #4 on: June 11, 2012, 04:53:20 pm »
I couldn't compile SFML because the gcc 4.6 do not include cstddef anymore, and because of that SFML couldn't know the what is the object NULL.

It's ok now, I sloved my problem by defining a new macro NULL in the ResourcePtr.inl file.

#undef NULL
#define NULL 0