Jump to content
  • Advertisement
Sign in to follow this  
nuclear123

visual studio building with or without MSVCR80.dll?

This topic is 2807 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
Simple answer to whether you should statically or dynamically link (let's use the funky new list tags):


  • DO - your software benefits from future updates from Microsoft to the runtime, including patching discovered security holes, preventing your software from joining the ranks of potentially malicious software that attacks users.
  • DON'T - you don't need to bother building an installer that puts the runtime on the user's computer as part of the installation process.


    My view - if you are trying to create a single zip that can be unzipped and run, it's worth either 1) not worrying about the above or 2) just sticking the bloody DLLs in the exe directory and waiting to be sued.

    If you are actually releasing some software that at the very least requires a file to be written inside the user profile somewhere, it is already your duty to use an installer and uninstaller so you can remove these files when your customer chooses to remove your program, so given the tiny size of the VS redist compared to, say, the mininal DX redist that you need to be installing (do you think your granny has DX9 C.0, even with a Dell Vista install? Fool), it's no great shakes to also install the VS runtime and protect your app against future threats/exploits/etc.

    Gone are the days when we can just release an exe and some data files. Even just putting a simple program on the net for people to try involves thinking through the installation and the uninstalltion quite carefully. Within that mindset, one more library installation is not really significant. Most of the AAA titles I've installed in the last three years install the VS redistributable.

    [EDIT] I'm not quite dealing with the fact that 'capital B' followed by a right parenthesis is turned into a smiley. This is not the place to discuss, but this is not right for a technical forum. Sorry. Changed to 1) and 2).

Share this post


Link to post
Share on other sites

My view - if you are trying to create a single zip that can be unzipped and run, it's worth either 1) not worrying about the above or 2) just sticking the bloody DLLs in the exe directory and waiting to be sued.

For what it's worth, the MSDN article on Choosing a Deployment Method states the following as one of its options:

Install a particular Visual C++ DLL in the same folder as the application by using files provide in the Program Files\Microsoft Visual Studio 10.0\VC\Redist directory. This way is recommended to enable installation of applications by users who do not have administrative rights or when it should be possible to run an application from a share.[/quote]
I fully agree that it's best to knock together an installer, though, for the reasons you stated.

Share this post


Link to post
Share on other sites
How do you statically link against VC8 and above runtimes?

I personally hate having to make a full installer, just for someone to critique my app. This is why, when I build a app that uses DirectX etc. I will build against the 'Summer 2003 DirectX SDK' and compile with VS.net 2003. This way (even after a clean install of Windows XP) I know that any user can run my programs from a single executable with no additional dll's. ;)

Share this post


Link to post
Share on other sites

How do you statically link against VC8 and above runtimes?

I personally hate having to make a full installer, just for someone to critique my app. This is why, when I build a app that uses DirectX etc. I will build against the 'Summer 2003 DirectX SDK' and compile with VS.net 2003. This way (even after a clean install of Windows XP) I know that any user can run my programs from a single executable with no additional dll's. ;)


In Project->Properties->Configuration Properties->C/C++->Code Generation, change the Runtime Library from /MD to /MT for release or /MDd to /MTd for debug.

Share this post


Link to post
Share on other sites

For what it's worth, the MSDN article on Choosing a Deployment Method states the following as one of its options:

Install a particular Visual C++ DLL in the same folder as the application by using files provide in the Program Files\Microsoft Visual Studio 10.0\VC\Redist directory. This way is recommended to enable installation of applications by users who do not have administrative rights or when it should be possible to run an application from a share.

[/quote]

Interesting, didn't realise that was allowed. Seems kind of pointless as opposed to static linking as you're not going to benefit from patches to the runtime, but I suppose you could manually update the DLLs for your users without having to re-distribute the exe.

Share this post


Link to post
Share on other sites

Interesting, didn't realise that was allowed. Seems kind of pointless as opposed to static linking as you're not going to benefit from patches to the runtime, but I suppose you could manually update the DLLs for your users without having to re-distribute the exe.

It (basically) wasn't allowed with 2005 and 2008. It was something you could do with 2003 and earlier and people bitched enough that they reallowed it for 2010. But mostly it's for people who don't want to write a full installer that have other DLL dependencies. Ex: your app plus the SDL DLL both depending on the CRT DLLs.

Share this post


Link to post
Share on other sites

Interesting, didn't realise that was allowed. Seems kind of pointless as opposed to static linking as you're not going to benefit from patches to the runtime, but I suppose you could manually update the DLLs for your users without having to re-distribute the exe.
It works the other way around as well. You don't need to update the runtime if you're just updating your exe.

Share this post


Link to post
Share on other sites

It (basically) wasn't allowed with 2005 and 2008. It was something you could do with 2003 and earlier and people bitched enough that they reallowed it for 2010. But mostly it's for people who don't want to write a full installer that have other DLL dependencies. Ex: your app plus the SDL DLL both depending on the CRT DLLs.

Thats good news too. I didn't realise this either. B)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!