News for hackers. Stuff that matters.
Re:Windows is not a Microsoft Visual C/C++ Run-Time delivery... by rwallace on Saturday April 12, 2014 @12:01AM (#7576921)
Microsoft C++ supports static linking with the standard library, which you should be using for release builds. That way, your program will always be using the exact version of the standard library that it was tested with, and it's guaranteed not to interfere with anything else on the target system.
Re:Windows is not a Microsoft Visual C/C++ Run-Time delivery... by jevinskie on Saturday April 12, 2014 @01:07AM (#7577041)
What can you do for the situation where you ship a library instead of an executable?

My team's product is moving to statically link libstdc++ and libgcc thanks to the runtime linking exception in GCC. It will allow us to use C++11 on old systems. We are grateful that libstdc++ is backwards compatible to GCC 3.4 (other libstdc++'s can link against us)!

I'm looking into statically linking musl libc so our product could (in theory) run on any 2.6/3.0 kernel. =)

Re:Windows is not a Microsoft Visual C/C++ Run-Time delivery... by vetinari on Saturday April 12, 2014 @04:17PM (#7579029)
glibc itself is not supposed to be linked statically, because it itself dlopens other shared libraries - for pam, for nsswitch, etc. These are system specific (as configured by admin), so there is no one size fits all.

You may statically link another libc, but then the users may wonder why your app does not works as it should, when they configure nsswitch for example and your app will not respect that.

Re:Windows is not a Microsoft Visual C/C++ Run-Time delivery... by stinos on Saturday April 12, 2014 @03:15AM (#7577227)
on the other hand there's the issue as stated in one of the other comments: If an application breaks because the internals of a library were changed, that's none other than the applications' fault.

All the occasions we had an application only crash on client's machine where alway due to bugs in our code, not in the platform. (not saying that it can't happen, but it seems rare for the type of app we do) So I'd rather expose bugs by 'surrendering' to the target machine completely, than to simply never find them.

Re:Windows is not a Microsoft Visual C/C++ Run-Time delivery... by rwallace on Saturday April 12, 2014 @06:53AM (#7577538)
As Raymond Chen explains at length in a few of his posts, this does not matter. Sure, there's a sense in which the bug is your fault for not being infallible, but what of that? We already knew we aren't infallible. The point is, that kind of live fire debugging punishes your users, not you. And as long as you keep doing it that way, it's going to end up hitting your users in a situation where you aren't around to fix the bug.

I did say you should use static linking in the release build. If you want to keep virtual machines with every version of Windows and/or the run-time library you can lay hands on in order to test debug builds of your program against them so you can find the bugs instead of letting users trip over them, there's certainly nothing wrong with that.

Re:Windows is not a Microsoft Visual C/C++ Run-Time delivery... by dblohm7 on Sunday April 13, 2014 @02:39AM (#7580487)
OTOH by linking statically you cannot distribute CRT bug fixes without building new binaries. Ideally the CRT DLLs are installed with Windows Installer and can then be updated via Windows Update.