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

Author Topic: Problems with gcc 4.6  (Read 1877 times)

0 Members and 1 Guest are viewing this topic.

priomsrb

  • Newbie
  • *
  • Posts: 38
    • View Profile
Problems with gcc 4.6
« on: April 09, 2011, 09:40:28 am »
Since I have upgraded to gcc 4.6, I get errors when compiling my sfml project. For example:  

Code: [Select]
/usr/include/SFML/System/ResourcePtr.inl:31: error: ‘NULL’ was not declared in this scope

I looked this up and it seems that in gcc 4.6 STL headers don't include <cstddef> any longer.

I could manually work around this by adding "#include <cstddef>" to ResourcePtr.inl myself but I hope there is a better way than that.

Is anyone else using gcc 4.6 getting this problem?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Problems with gcc 4.6
« Reply #1 on: April 09, 2011, 09:51:51 am »
Yes, and it's already fixed in SFML 2. Instead of including <cstddef> to ResourcePtr.hpp you can include it in your own program, before SFML headers.
Laurent Gomila - SFML developer

priomsrb

  • Newbie
  • *
  • Posts: 38
    • View Profile
Problems with gcc 4.6
« Reply #2 on: April 09, 2011, 10:16:29 am »
Ok. I think I'll do that. Thanks for your quick answer.

 

anything