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

Author Topic: Couple'a questions regarding distribution (dependency hell)~  (Read 1027 times)

0 Members and 1 Guest are viewing this topic.

Mina

  • Newbie
  • *
  • Posts: 1
    • View Profile
hi~

i've been trying to get to fully know the dependencies of my sfml program, so that i can make somewhat of a guarentee of platforms it 'should' work on without a problem. so i have a couple'a questions~

1. i've compiled the sfml libs from source with vs2010 and dynamically linked to the c/c++ runtimes (same as the program sfml will be linked too, of course). when i statically link the static sfml libs into my program, i get a linker warning (LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library). this confuses me for a start, because that is apparently the static runtime library, but as i already mentioned everything was compiled with /MD. i'm also confused to see that some of the static smfl libs have linker directives to msvcrt. anyway, i know that i can /NODEFAULTLIB:libcmt or msvcrt, but i'm really interested in knowing the consequences of this, and _why_ this is happening.

2. i'm seeing the system msvcrt being a dependency of libsndfile-1.dll, so i'm curious what the compatability is like for those two external libs in the sfml distribution. is this even worth worrying about? i have read that the system msvcrt can be many different versions throughout the msvc history and that it's only forwards compatible, is that true?

i hope someone can help me learn the 'why' of how this binary dependency stuff works so i can have some confidence to ship an sfml program.

thanks for reading~

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Couple'a questions regarding distribution (dependency hell)~
« Reply #1 on: July 20, 2012, 10:22:07 am »
As long as the application runs upon getting that warning, you're good. I'm not quite sure why it happens but it's Microsoft's fault afaik. The problem is, that VS gets confused with the diffrent runtime libraries (for some reason). If you want to get rid of that warning (or in some cases they can tilurn into errors) you have to explicitly exclude all the diffrent runtime libraries you dom't want (Project->Settings->Linker->Input).

If you compile against the SFML audio module you'll hace to include the libsndfile-1.dll and the openal32.dll with your application (they come with the SDK).
For general deployment you to ship the SFML dlls if you've linked dynamically and the MCVS redistribution package if you've linked the runtime library dynamically.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/