More support for what? Are you just talking about the INCLUDE_STATIC_LIBS CMake option, or something else?
More flexibility regarding static linking whether on Linux or Windows. This includes INCLUDE_STATIC_LIBS as well as choosing the link type of other libraries at will (which includes possibly linking GLEW dynamically, which as you mentioned is a known problem).
What's broken? What would you improve?
All those previous discussions you, me and Tank have had.
"must" is used here because it has to match what's used in the code.
I meant the fvisibility thing all together including the part in Config.hpp. I find that hiding symbols isn't really needed.
He has to do it anyway, there's nothing to decide. So why not do it for them?
I know SFML isn't licensed under GPL, but the idea here is freedom. Let the user decide what is best for them. In case a new version of GLEW or one of those other libraries comes out let the user decide whether they want to use that new library or not. Or on the contrary, if he wants to use a far older version of the library that is stable and does exactly what he needs he would want to link against that himself too.
Why would I export internal classes and functions? In case you didn't notice, this flag is used only when building shared libraries.
Because it doesn't hurt if you don't provide the interface for them anyway? And not to mention you go through a lot of effort to not export them.
It's like putting a knife in a safe on a tall table rather than just leaving it on a tall table so that a child can't reach it.
No. The first thing has nothing to do with the second. I include dependencies in SFML static libraries so that users don't have to do it theirselves. The result is the same though.
By the way, what do you mean with "export them"? It's a static library, everything which is in it is accessible, isn't it?
#include <SFML/Window.hpp>
#include <GL/GLEW.h>
int main()
{
sf::Context context;
glewInit();
return 0;
}
This code fails to link with:
undefined reference to _imp__glewInit
although I link to sfml-graphics-s-d and have SFML_STATIC defined.
Sifting through the nm dump of libsfml-graphics-s-d.a you find:
glew.c.o
...
00016f7c T _glewInit
...
T meaning the symbol is in the text section.
This is expected because you include GLEW into sfml-graphics, however above that entry you also find:
GLCheck.cpp.obj:
...
U _glewInit
U meaning the symbol is
undefined.
I do not know what causes glewInit to be redefined but as an answer to your question, this is how you "not export symbols" in a static library. I don't know how I would do this because I have never had to do this but this is quite annoying and it would be nice to find a fix for it.
edit: I realized I forgot to define GLEW_STATIC which makes the linker error disappear.
And I also assume that the same symbols are used at different places, some of them being undefined until the linker resolves them inside the same static library archive. I will try to construct an example where the GLEW linking problem we had in SFGUI is displayed in a simpler way.