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

Author Topic: Compile error on Linux  (Read 2724 times)

0 Members and 1 Guest are viewing this topic.

KraXarN

  • Newbie
  • *
  • Posts: 12
  • Stuffs and things
    • View Profile
Compile error on Linux
« on: September 28, 2016, 09:14:49 pm »
Hello!
Trying to compile my code on Linux, but it won't work. Same code used on Windows and Mac and both works just fine.
Here are the errors I'm getting:

/usr/include/SFML/Network/Socket.hpp:53:10: error: expected identifier before ‘int’
     enum Status
          ^

/usr/include/SFML/Network/Socket.hpp:54:5: error: expected unqualified-id before ‘{’ token
     {
     ^

/usr/include/SFML/Network/Ftp.hpp:74:14: error: expected identifier before ‘int’
         enum Status
              ^

/usr/include/SFML/Network/Ftp.hpp:75:9: error: expected unqualified-id before ‘{’ token
         {
         ^

/usr/include/SFML/Network/Ftp.hpp:146:41: error: ‘InvalidResponse’ was not declared in this scope
         explicit Response(Status code = InvalidResponse, const std::string& message = "");
                                         ^~~~~~~~~~~~~~~
/usr/include/SFML/Network/IpAddress.hpp:184:28: error: expected unqualified-id before numeric constant
     static const IpAddress None;      ///< Value representing an empty/invalid address
                            ^

/usr/include/SFML/Network/Http.hpp:201:14: error: expected identifier before ‘int’
         enum Status
              ^

/usr/include/SFML/Network/Http.hpp:202:9: error: expected unqualified-id before ‘{’ token
         {
         ^

Thanks! :)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Compile error on Linux
« Reply #1 on: September 29, 2016, 08:05:59 pm »
As far as I remember, there is some stupid Linux header that has a Done macro. Or Status. None may also be concerned.

Always include SFML last (if possible) and the error should go away. Or #undef the symbol before including SFML headers.
Laurent Gomila - SFML developer

KraXarN

  • Newbie
  • *
  • Posts: 12
  • Stuffs and things
    • View Profile
Re: Compile error on Linux
« Reply #2 on: September 29, 2016, 10:26:57 pm »
Yes, Status was already defined in some X11 header. I fixed it with #undef before the SFML stuff. None and BadRequest was also already defined. After undefining those as well, it compiles and runs just fine!

Thanks for the help, but this might be something that needs to be changed.
It seems to run fine though.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Compile error on Linux
« Reply #3 on: September 30, 2016, 07:35:06 am »
Quote
Thanks for the help, but this might be something that needs to be changed.
I doubt that Xlib headers, as stupid as it is to #define such common symbols, will ever change. And SFML will certainly not try to work around that ;)
Laurent Gomila - SFML developer