Hi! I have been searching around for the cause of this issue all day, so excuse me if this question has been answered anywhere; because I haven't found it yet!
There have been a few references to this issue, but no solutions as far as I can tell.
I have a project that I am working on a Linux port for. The project uses SFML's networking module, but I am posting in this section because (judging by other posts) the issue seems to be unrelated to specific modules in SFML.
Here's the error output:
g++ -Wno-attributes -std=c++11 -c main.cpp -o main.o
In file included from XWindow.h:6:0,
from Window.h:18,
from main.cpp:2:
/usr/include/SFML/Network/Socket.hpp:53:10: error: expected identifier before ‘int’
enum Status
^
In file included from /usr/include/SFML/Network/TcpSocket.hpp:32:0,
from /usr/include/SFML/Network/Ftp.hpp:32,
from /usr/include/SFML/Network.hpp:33,
from SFMLPacket.h:3,
from main.cpp:20:
/usr/include/SFML/Network/Socket.hpp:54:5: error: expected unqualified-id before ‘{’ token
{
^
In file included from XWindow.h:6:0,
from Window.h:18,
from main.cpp:2:
/usr/include/SFML/Network/Ftp.hpp:74:14: error: expected identifier before ‘int’
enum Status
^
In file included from /usr/include/SFML/Network.hpp:33:0,
from SFMLPacket.h:3,
from main.cpp:20:
/usr/include/SFML/Network/Ftp.hpp:75:9: error: expected unqualified-id before ‘{’ token
{
^
In file included from /usr/include/SFML/Network.hpp:33:0,
from SFMLPacket.h:3,
from main.cpp:20:
/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 = "");
^
In file included from /usr/include/X11/Xlib.h:44:0,
from XWindow.h:6,
from Window.h:18,
from main.cpp:2:
/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
^
In file included from XWindow.h:6:0,
from Window.h:18,
from main.cpp:2:
/usr/include/SFML/Network/Http.hpp:201:14: error: expected identifier before ‘int’
enum Status
^
In file included from /usr/include/SFML/Network.hpp:34:0,
from SFMLPacket.h:3,
from main.cpp:20:
/usr/include/SFML/Network/Http.hpp:202:9: error: expected unqualified-id before ‘{’ token
{
^
makefile:19: recipe for target 'main.o' failed
make: *** [main.o] Error 1
There are, of course, many other files in the project. However, they compile without issue.
I have checked the relevant file in my project (SFMLPacket.h) but I see no problems in there. It seems to be the fact that it includes SFML/Network.hpp rather than an issue in our code.
I highly doubt it's a legitimate error in SFML's code (it would have been noticed by now!), so is this some kind of incompatibility with other Linux headers or something? What can I do about fixing it?
Thank you very much.