SFML community forums
Help => Window => Topic started by: Juanxo on June 20, 2010, 09:37:35 am
-
hey all:
first sorry if this bug has been already reported.
while i was compiling one project with sfml 1.6, i get an error about some constant value in WindowStyle.hpp.
Searching the web, i have found this link that complains about the same situation: gamedev (http://www.gamedev.net/community/forums/topic.asp?topic_id=513501)
Some quick fix to repair it?
-
The only quick fix that you can do is making sure that you never include XLib headers before SFML ones.
-
thx Laurent.
I only use sfml and Assimp, so perhaps some sfml files include Xlib headers?
EDIT: i have seen that cmake includes xlib before sfml. I have to find a way to change this.
Thanks
-
SFML include Xlib internally, it doesn't produce any conflict in user code.
i have seen that cmake includes xlib before sfml. I have to find a way to change this.
What do you mean? What's the relation with CMake?
-
i'm using cmake to create my project makefile and it seems that the makefile created by cmake includes xlib before sfml
-
The makefile doesn't include anything, it's in your code that you have to find and swap the guilty #include statements.
-
cmake generates automatically makefiles for projects, and it seems to include xlib in linux. I don't include xlib in my code directly, causes i'm trying to programm cross-platform code.
I have the same code and the same cmakelists for windows and linux and i don't get any error in windows
-
But makefiles don't include headers ;)
If XLib.h gets included, it's because somehere in your headers (or most likely in one of the external headers that you include) there is a #include <XLib.h>.
Sometimes its burried deeply inside headers, so it may be hard to figure out which header leads to #include <XLib.h>. A simple solution is to always include SFML (and headers that include SFML) first.
You don't get any error on Windows because XLib is a Linux library.
-
thx Laurent
I have found where "I" include it. it seems GLee uses Xlib.
Now the problem is that i cant include it before SFML, but SFML includes Opengl, and GLee need to be included before OpenGL.
This is crazy, man
-
This is crazy, man
I agree. Defining None with a macro is definitely a disaster... Especially in such a common system header.
However I think there is another solution: #undef None after including Glee.h.
-
thx Laurent.