Hi. I am confirming that I, Xander
314, am SFMLCoder. (Note the number 314 as this site has a few other Xanders). I may also go by the name of Xephyr from time to time, though it's already taken on many sites.
More importantly and out of curiosity why do you not include sfml-main-d.lib in your linking? |
All the other libraries are either static libraries, or import libraries to provide access to DLLs, for SFML window, system, graphics, audio and networking functionality.
sfml-main.lib (release build) and sfml-main-d.lib (debug build) are somewhat different. They are both static libraries (no dynamic/import library versions).
As for what they do? I shall try and explain now. My explanation may seem off topic at first, but bear with me ;)
As you probably know, the entry point for a C++ console application is
int main(int, char*[])
. But what if you don't want the console window with your application. Then you make it a windowed application. As I understand it, the entry point for windowed applications on Unix operating systems (Mac, Linux, ...) is still
int main()
.
However, the entry point for a windowed application on Windows is
int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, INT)
. So if you want an SFML application with no console window on Windows, you must use this entry point. But then your code is not very portable - it will no longer compile for Unix as it has a WinAPI specific entry point.
The solution is sfml-main.lib and sfml-main-d.lib. Basically, it's code is very simple. If you compile it on Windows, it creates the Windows entry point
int WINAPI WinMain(...)
, and calls the console entry point
int main(...)
from it. On Unix, it contains no code at all.
Thus by linking to this static library, you can always use the
int main(...)
entry point, and if you are making a windowed application on Windows, sfml-main.lib ensures that the linker can find the correct entry point.
I hope this helps you understand the purpose of sfml-main-d.lib. As for why I don't link to it, it's because I always use the console entry point. However, I am meaning to rerecord my SFML setup videos on my YouTube channel, to include information about this.
-SFMLCoder
http://sfmlcoder.wordpress.com/
http://www.twitter.com/Xander_314/
http://www.youtube.com/SFMLCoder/
http://on.fb.me/oetKbT