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

Author Topic: Conflict with X11  (Read 785 times)

0 Members and 1 Guest are viewing this topic.

Blink

  • Newbie
  • *
  • Posts: 4
    • View Profile
Conflict with X11
« on: April 06, 2014, 04:41:00 am »
So I had an issue with X11 and the Networking module where Status was defined as an int in X11 but used as an enum in SFML. My fix was that I separated the file using Glee from the file using SFML's networking, so they don't reference the two libraries at the same time, and this worked, but if I ever did need to use both in one file then that might be a problem. Here's the error log:

Quote
clang++  -c src/lodepng.cpp -o bin/lodepng.o
clang++   -c src/flatRender.cpp -o bin/flatRender.o
In file included from src/flatRender.cpp:20:
In file included from src/networking.h:15:
In file included from /usr/local/include/SFML/Network.hpp:33:
In file included from /usr/local/include/SFML/Network/Ftp.hpp:32:
In file included from /usr/local/include/SFML/Network/TcpSocket.hpp:32:
/usr/local/include/SFML/Network/Socket.hpp:53:10: error: unnamed enumeration must be a
      definition
    enum Status
         ^
/usr/include/X11/Xlib.h:87:16: note: expanded from:
#define Status int
               ^
In file included from src/flatRender.cpp:20:
In file included from src/networking.h:15:
In file included from /usr/local/include/SFML/Network.hpp:33:
/usr/local/include/SFML/Network/Ftp.hpp:74:14: error: unnamed enumeration must be a
      definition
        enum Status
             ^
/usr/include/X11/Xlib.h:87:16: note: expanded from:
#define Status int
               ^
In file included from src/flatRender.cpp:20:
In file included from src/networking.h:15:
In file included from /usr/local/include/SFML/Network.hpp:33:
/usr/local/include/SFML/Network/Ftp.hpp:146:41: error: use of undeclared identifier
      'InvalidResponse'
        explicit Response(Status code = InvalidResponse, const std::string& ...
                                        ^
In file included from src/flatRender.cpp:20:
In file included from src/networking.h:15:
In file included from /usr/local/include/SFML/Network.hpp:34:
In file included from /usr/local/include/SFML/Network/Http.hpp:32:
/usr/local/include/SFML/Network/IpAddress.hpp:184:28: error: expected member name or ';'
      after declaration specifiers
    static const IpAddress None;      ///< Value representing an empty/invalid address
    ~~~~~~~~~~~~~~~~~~~~~~ ^
/usr/include/X11/X.h:115:30: note: expanded from:
#define None                 0L /* universal null resource or null atom */
                             ^
In file included from src/flatRender.cpp:20:
In file included from src/networking.h:15:
In file included from /usr/local/include/SFML/Network.hpp:34:
/usr/local/include/SFML/Network/Http.hpp:199:14: error: unnamed enumeration must be a
      definition
        enum Status
             ^
/usr/include/X11/Xlib.h:87:16: note: expanded from:
#define Status int
               ^

but all I had to do was remove networking.h from flatRender, where flatRender has an include "GLee.h", and then it worked. This had me stuck for a while until I was really seeing exactly where the error came from, then I realized that my code was modular enough (go self! :P) that I didn't need to reference my networking.h file in flatRender, and removing it plus the one sprintf that used it seemed to solve everything. None of the other SFML libraries (window/graphics/system) referenced in flatRender caused issue.

Hope this helps!