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

Author Topic: Laurent's Visual Studio 11 STATIC build  (Read 3366 times)

0 Members and 1 Guest are viewing this topic.

Dúthomhas

  • Newbie
  • *
  • Posts: 6
    • View Profile
Laurent's Visual Studio 11 STATIC build
« on: August 27, 2013, 06:34:34 am »
I don't know if I'm doing something wrong...

I want to build both dynamically (works like a charm) but with VS on the command-line I'm getting a lot of
Quote
error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in fooey.obj

in the official stuff found here http://www.sfml-dev.org/download/sfml/2.1/

I had to download eXpl0it3r's nightly build (http://sfml.my-gate.net/nightly/), which has a separate little directory with the static stuff.

Once I did that, the following works swimmingly:

Quote
cl /EHsc /Ox /MT fooey.cpp sfml-graphics-s.lib sfml-window-s.lib sfml-system-s.lib sfml-main.lib user32.lib

I'm pretty sure there's something mis-configured about the official build.

As a side note, eXpl0it3r also had mis-configured sfml-foo-s.lib files in the regular lib directory...

I just think that if a 'drop-in' kind of download is provided, it ought to have the sfml*-s*.lib files properly configured...

(Unless I missed something really obvious. I don't know how many people try to do things from the command line like me...)

Thanks for reading.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Laurent's Visual Studio 11 STATIC build
« Reply #1 on: August 27, 2013, 07:52:51 am »
If you select MT_StaticRelease in your project settings, any library that you use must use this parameter too. Unfortunately, SFML is compiled with MD_DynamicRelease (the most common and safe choice), so as eXpl0it3r's libraries in /lib. However eXpl0it3r also provides SFML libraries compiled with MT_StaticRelease, in /lib/static-std, that's why those work for you.

So it's not SFML which is misconfigured, just you not knowing what this error message means and involves ;)
Laurent Gomila - SFML developer

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: Laurent's Visual Studio 11 STATIC build
« Reply #2 on: August 27, 2013, 10:17:26 am »
Yep I build all the variants, but non of them are wrong.

lib/sfml-xxx(-d) = Shared SFML library with shared runtime library [/MD(d)]
lib/sfml-xxx-s(-d) = Static SFML library with shared runtime library [/MD(d)]
lib/static-lib/sfml-xxx-s(-d) = Static SFML library with static runtime library [/MT(d)]
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Dúthomhas

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Laurent's Visual Studio 11 STATIC build
« Reply #3 on: August 27, 2013, 01:52:04 pm »
....aaaAAAAAaaahhh....

My new system is the first one that I've ever been able to use VC++ with (my last one was one of the few that .NET 3.5 refused to install with), so I'm still learning how to use VC++.... I didn't know you could build a DLL that way... Before now I've been using GCC/MinGW almost exclusively.

In any case, thank you both for clearing that up for me!