SFML community forums
Bindings - other languages => C => Topic started by: Jebbs on September 02, 2013, 07:19:37 pm
-
I had this issue when I was building my modified version of CSFML, but I also encountered this when I built CSFML too. Before I go farther I want to mention that I have only used MingW so far to compile my stuff, and this is my first experience with building SFML with VS. Basically the "problem" I am experiencing is that I am able to build the SFML static libraries no problem, but when I build the CSFML dll's, VS doesn't seem to actually link the static libraries into the shared libraries when it builds them. I only noticed this because the size of my dll's were quite small. Is there something I need to do in order to get this to happen?
Some info:
I'm not using NMake. I'm having CMake create Project files and I just open those up in VS to build them.
I'm using VS 11.
Thanks in advance for the help!
-
VS doesn't seem to actually link the static libraries into the shared libraries when it builds them. I only noticed this because the size of my dll's were quite small
And? Did you try them? What error(s) do you get?
-
VS doesn't seem to actually link the static libraries into the shared libraries when it builds them. I only noticed this because the size of my dll's were quite small
And? Did you try them? What error(s) do you get?
Huh, they seem to work. :-[
They are MUCH smaller than the ones you have for download though which is a little confusing to me. Maybe it's just a build setting I'm not aware of.
-
The ones in the official packages are compiled with standard library linked statically. That's why they are bigger than yours.
-
Does linking the standard library statically improve compatibility or something?
-
It removes the very last dependencies, so that the CSFML DLLs depend on nothing at runtime (other than the sfml-audio LGPL dependencies: libsndfile and OpenAL) and can be used on any system with any compiler.
-
The ones in the official packages are compiled with standard library linked statically. That's why they are bigger than yours.
I thought I was. I use the CMake gui, and for both SFML and CSFML I have the box checked for using static std libs.
It works though, so I guess that's all I should worry about.
It removes the very last dependencies, so that the CSFML DLLs depend on nothing at runtime (other than the sfml-audio LGPL dependencies: libsndfile and OpenAL) and can be used on any system with any compiler.
And since I am using them for a binding in a different language, this is important.
-
You should check the dependencies of your CSFML binaries, with Dependency Walker. If there's no msvxxx.dll then it's good.
-
I just used Dependency Walker like you suggested. Never used it before so I'm not sure if I'm reading it correctly, but I see msvcrt.dll in a couple of places. That's the only msvxxx.dll I see.
I would like to have the dll's free of any external dependencies, but I am very unfamiliar with Visual Studio. Is there something I missed in CMake?
-
It depends where you saw those msvcrt.dll. At top-level? Or as a dependency of a system DLL?
-
It's listed as a dependency of a couple of dll's. See attached for a couple examples.
In the future I'm going to test things myself before I post here though. :P
-
If it's a dependency of system DLLs then everything's ok on your side.