470,814 Members | 1,195 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Share your developer knowledge by writing an article on Bytes.

Static Linking to stop Visual C++ RTL and MSVCR80.dll problems.

212 128KB
This works:
Compile C++ Code with STATIC LINKING without a dependency on any exterior MSVCR80.dll (or other versions of MSVCxxx.dll's).
Some history:
I was compiling a C++11 program and I put too many items into a vector array and I got an error message: Microsoft Visual C++ Runtime Library Error. I do not have MS VC++ installed on my computer. I pushed another limit and was again reminded of Microsoft's aggressive backdoor insertion policy.
A tiny bit of response:
I have been researching this (Visual C++ RTL related) and found that for many programs to run on MS Windows that a MS VC++ RTL is commonly assumed to be a requirement. Not totally, but for many people, it seems to be an assumption.

I had found that years ago. But, I was reminded recently to remain aware.
At any time, if you allow updates to your operating system from Microsoft (due to your stupidity or ignorance or not caring or etc.), then those dll's might be changed by Microsoft, or they might be changed by some others, whomever and to inject code into your program (via the dynamic dll).
For other programmers, this is what might has happened:
A C++ programmer, and I guess maybe a C programmer, programming on a Microsoft Windows operating system codes a program not using any Visual Studio IDE. No VS C++ IDE. But, they are advised to use dynamic linking to dll's and they did not consider the consequences sufficiently. That dynamic linking has had the potential of severe anti-security.
Some fixes if you do not want that aggressive anti-security back-door:
  1. If you have to use dll's dynamically, then: Try to only use any dlls which you did study the code for security concerns and then compile the program yourself outside of a MS VS IDE environment. Try to use hard-coded one-time-pad encryption for your program's communicating with that dll.
  2. Compile C++ Code with STATIC LINKING without a dependency on any exterior MSVCR80.dll (or other versions of MSVCxxx.dll's). It might make the size of your executable larger, but look at this option like adding a shield to your exe.

Microsoft already told you about this.

Microsoft told you about this many times. Over and over again. Microsoft told you that their security breaches (from Microsoft) are what you want. Microsoft told you that you like this and that this is what you have been asking for. This is nothing new. I am not revealing some dark secret. You have been told this for year after year (since about 2004) by Microsoft. It is up to YOU to think or suffer the consequences of others thinking for you. You know this.

Think. God gave you a brain. Use it.

Only use static linking.
Do not use dll's that you did not create and compile yourself.

Until MS changes it, see a related discussion here.
Feb 22 '21 #1
0 1533

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by daniel_shaw01 | last post: by
1 post views Thread by GMartin | last post: by
2 posts views Thread by ashesman | last post: by
7 posts views Thread by =?Utf-8?B?UmFtZW5kcmEgS290aGFya2Fy?= | last post: by
2 posts views Thread by Mohsen A. Momeni | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.