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

Author Topic: Redistribute static without Microsoft Redistribution Files  (Read 6535 times)

0 Members and 2 Guests are viewing this topic.

Poraft

  • Newbie
  • *
  • Posts: 24
    • View Profile
Redistribute static without Microsoft Redistribution Files
« on: September 12, 2012, 11:55:44 pm »
Hello,

I'm using Windows 7 and SFML pre-RC build for Microsoft Visual C++ 2010 and want to test my application on other computers, like school PC's. I can't install anything on those PCs. But how do I manage this.

What I've tried:

-Release SFML staticly on /MT then when I try to compile it starts crying about multiple symbols, so I allowed multiple symbols. Then it builds fine, but when I try to run it gives the error:

Quote
The procedure entry point ??1_NonReentrantPPLLockHolder@details@concurrency@@blaball
cout not be located in the dynamic link library MSVCR100.dll

Or should  just building it on Release, static, /MD. And then include the msvcp100 and msvcr100 work?

Thanks!

« Last Edit: September 12, 2012, 11:58:23 pm by Poraft »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Redistribute static without Microsoft Redistribution Files
« Reply #1 on: September 13, 2012, 12:07:39 am »
Build SFML with static runtime libraries and use /MT in your application.
Don't allow multiple symbols, since this will cause problems, only allow the runtime library that is really used by excluding the other ones. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Poraft

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Redistribute static without Microsoft Redistribution Files
« Reply #2 on: September 13, 2012, 12:20:12 am »
I know little about the building libraries, but how do I build SFML ontop of my other build? Won't they get ambiguous?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Redistribute static without Microsoft Redistribution Files
« Reply #3 on: September 13, 2012, 12:23:15 am »
I know little about the building libraries, but how do I build SFML ontop of my other build? Won't they get ambiguous?
Hu? ???

You compile SFML newly at the location you want with the runtime library static and SFML static and then you match your projects settings to the library settings, i.e. setting /MT and link against the new libraries.

How to build SFML libraries on your own is described in the tutorial, just don't forget to set the wanted settings. ;)

An easier way (I think) would be to link dynamically as usually and just provide the needed runtime .dll next to the application.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Poraft

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Redistribute static without Microsoft Redistribution Files
« Reply #4 on: September 13, 2012, 12:43:54 am »
Ahh, ok thanks for clearing that up.

I'm going to try to link it dynamically, and provide those DLLs. And from the "as usually" I make up it's better to link dynamically?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Redistribute static without Microsoft Redistribution Files
« Reply #5 on: September 13, 2012, 01:11:23 am »
And from the "as usually" I make up it's better to link dynamically?
There are many reasons in favor for dynamic linkage, e.g. if you ever need to update something you can just provide a new .exe which doesn't have the library linked into it, thus the filesize is smaller, or the memory footprint can be smaller, etc.
But there are also the arguments for static linkage like dependencies, etc.
Google will tell you a lot about it.

For the Windows platform, both ways are a possibility where there's no sense on Linux platforms for static linking. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Atani

  • Newbie
  • *
  • Posts: 30
    • MSN Messenger - atanisoft@hotmail.com
    • AOL Instant Messenger - AtaniSYSOP
    • Yahoo Instant Messenger - atanisoft
    • View Profile
    • Email
Re: Redistribute static without Microsoft Redistribution Files
« Reply #6 on: September 13, 2012, 01:49:50 am »
For the Windows platform, both ways are a possibility where there's no sense on Linux platforms for static linking. ;)

Correction, there are very few reasons to ever use static linking on Linux. Primarily static linking is done by companies producing close source software and releasing it as a static bundle with all dependencies contained within it.  A prime example of this is Rational ClearCase (now owned by IBM). I remember jumping through a lot of hoops to get CC working on a 2.4 kernel because the 2.5 kernels were not yet supported for the MVFS module.

Mike

Poraft

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Redistribute static without Microsoft Redistribution Files
« Reply #7 on: September 13, 2012, 12:23:22 pm »
I'm at school right now I've got the same problem with dynamically building it + the necesarry DLL files. But I get the same error as provided with my first post.

What do?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Redistribute static without Microsoft Redistribution Files
« Reply #8 on: September 13, 2012, 12:57:54 pm »
If you refer to:
Quote
cout not be located in the dynamic link library MSVCR100.dll
Then you haven't provided the right libraries, but I'm not even sure if that works to 100%...

You can google for MSVCR100.dll, download it and place it next to your exe.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Redistribute static without Microsoft Redistribution Files
« Reply #9 on: September 13, 2012, 02:00:07 pm »
You have multiple possibilities:
  • Link the CRT statically. You must set SFML's CMake flag SFML_USE_STATIC_STD_LIBS to true. Don't modify the generated projects manually! In the project that uses SFML, specify /MT or /MTd.
  • Ship your application with the required DLLs for the MSVC runtime. I think these are msvcp100.dll and msvcr100.dll.

You can google for MSVCR100.dll, download it and place it next to your exe.
I wouldn't risk malicious binaries, when the DLL is already on my computer (which is the case if Visual Studio 2010 is installed).
« Last Edit: September 13, 2012, 02:02:22 pm by Nexus »
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Poraft

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Redistribute static without Microsoft Redistribution Files
« Reply #10 on: September 13, 2012, 02:45:53 pm »
Well the problem is; I already did put MSVCR100.dll and MSVCP100.dll (the 2 the .exe is asking for) in the same directory, where the .exe is which is on an USB stick.

Even when I run my .exe from my usb on my own PC gives the same error.
« Last Edit: September 13, 2012, 02:48:25 pm by Poraft »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Redistribute static without Microsoft Redistribution Files
« Reply #11 on: September 13, 2012, 03:00:56 pm »
A quick Google search on the error message shows that there are multiple versions of these DLLs.

Have you tried with your own DLLs (the ones installed in your C:\Windows folder)?
Have you tried with the official "Visual C++ 2010 redistributable package" from Microsoft website?
Laurent Gomila - SFML developer

Poraft

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Redistribute static without Microsoft Redistribution Files
« Reply #12 on: September 13, 2012, 03:29:47 pm »

Have you tried with your own DLLs (the ones installed in your C:\Windows folder)?
Have you tried with the official "Visual C++ 2010 redistributable package" from Microsoft website?

Can't find mine in C:/Windows folder. Neither in the folder where visual is installed. No redist folder.
As I stated before, I won't be able to use the package since I want to run it on schoolcomputers.

And at school we have 32bit windows, and at home I have 64bit. I didn't know/can't find more dll versions of them.
« Last Edit: September 13, 2012, 03:38:11 pm by Poraft »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Redistribute static without Microsoft Redistribution Files
« Reply #13 on: September 13, 2012, 03:48:42 pm »
Quote
Can't find mine in C:/Windows folder.
Use the search function of your OS. They are located in a sub-folder (like system32 or WinSxS).

Quote
As I stated before, I won't be able to use the package since I want to run it on schoolcomputers.
I was suggesting that you install it on your computer and copy the DLLs from there.
Laurent Gomila - SFML developer

Poraft

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Redistribute static without Microsoft Redistribution Files
« Reply #14 on: September 13, 2012, 04:07:36 pm »
Apparently the searcher can't find them. //E: I found them by hand.
I've got them working on my usb now. Im going to try it tomorrow.

Thanks for all your help guys!
« Last Edit: September 13, 2012, 04:12:21 pm by Poraft »