Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Question about using Visual Studio when building CSFML  (Read 7740 times)

0 Members and 1 Guest are viewing this topic.

Jebbs

  • Sr. Member
  • ****
  • Posts: 358
  • DSFML Developer
    • View Profile
    • Email
Question about using Visual Studio when building CSFML
« 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!
DSFML - SFML for the D Programming Language.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Question about using Visual Studio when building CSFML
« Reply #1 on: September 02, 2013, 09:14:30 pm »
Quote
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?
Laurent Gomila - SFML developer

Jebbs

  • Sr. Member
  • ****
  • Posts: 358
  • DSFML Developer
    • View Profile
    • Email
Re: Question about using Visual Studio when building CSFML
« Reply #2 on: September 02, 2013, 09:46:31 pm »
Quote
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.
DSFML - SFML for the D Programming Language.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Question about using Visual Studio when building CSFML
« Reply #3 on: September 02, 2013, 10:49:16 pm »
The ones in the official packages are compiled with standard library linked statically. That's why they are bigger than yours.
Laurent Gomila - SFML developer

Ixrec

  • Hero Member
  • *****
  • Posts: 1241
    • View Profile
    • Email
Re: Question about using Visual Studio when building CSFML
« Reply #4 on: September 02, 2013, 11:08:31 pm »
Does linking the standard library statically improve compatibility or something?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Question about using Visual Studio when building CSFML
« Reply #5 on: September 02, 2013, 11:14:52 pm »
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.
Laurent Gomila - SFML developer

Jebbs

  • Sr. Member
  • ****
  • Posts: 358
  • DSFML Developer
    • View Profile
    • Email
Re: Question about using Visual Studio when building CSFML
« Reply #6 on: September 02, 2013, 11:18:51 pm »
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.

DSFML - SFML for the D Programming Language.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Question about using Visual Studio when building CSFML
« Reply #7 on: September 03, 2013, 07:42:08 am »
You should check the dependencies of your CSFML binaries, with Dependency Walker. If there's no msvxxx.dll then it's good.
Laurent Gomila - SFML developer

Jebbs

  • Sr. Member
  • ****
  • Posts: 358
  • DSFML Developer
    • View Profile
    • Email
Re: Question about using Visual Studio when building CSFML
« Reply #8 on: September 04, 2013, 01:09:52 am »
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?
DSFML - SFML for the D Programming Language.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Question about using Visual Studio when building CSFML
« Reply #9 on: September 04, 2013, 07:55:07 am »
It depends where you saw those msvcrt.dll. At top-level? Or as a dependency of a system DLL?
Laurent Gomila - SFML developer

Jebbs

  • Sr. Member
  • ****
  • Posts: 358
  • DSFML Developer
    • View Profile
    • Email
Re: Question about using Visual Studio when building CSFML
« Reply #10 on: September 05, 2013, 12:09:28 am »
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
DSFML - SFML for the D Programming Language.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Question about using Visual Studio when building CSFML
« Reply #11 on: September 05, 2013, 08:04:47 am »
If it's a dependency of system DLLs then everything's ok on your side.
Laurent Gomila - SFML developer

 

anything