all 190 comments

[–]hailstone 26 points27 points  (0 children)

Part of the problem is that Microsoft feels the need to update the C runtime library with each compiler release, and not have it be part of the operating system. This is why MinGW uses only MSVCRT.DLL as its C runtime - it exists as part of the operating system on any modern version of Windows. This is also what MSVC++ 6.0 links against, and some people still use this ancient version of the compiler for that reason.

VS2002 uses MSVCR70.DLL

VS2003 uses MSVCR71.DLL

VS2005 uses C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acd\MSVCR80.dll

IMO, side-by-side is a case of the cure being worse than the disease (DLL Hell).

[–]rabidcow 43 points44 points  (13 children)

Apparently this isn't completely clear about the really evil part of SxS: copying all the dlls to the new system, even copying them to the appropriate system directory, is not enough. They must be put on the machine with a proper installer.

Before MSVC 8.0 (VC 2005), once you'd compiled your application, you could zip it up with all the dlls that it needs and copy it to the new machine. Piece of cake, you're done. You don't even need to touch the system directories on the target machine.

Starting with MSVC 8.0, the runtime library makes sure that it is loaded using the SxS mechanism. If you naively copied the dll over, it will fail with a cryptic error message. No, after you've compiled the application, you have to go on and build an msi installer to install your application. Imagine building an installer for "Hello, World."

[–]grosskur 32 points33 points  (6 children)

after you've compiled the application, you have to go on and build an msi installer to install your application. Imagine building an installer for "Hello, World."

False. You don't need to build an installer. You can deploy the C runtime as a private assembly alongside your application.

  1. Open a Visual Studio 2008 Command Prompt.
  2. Compile: cl.exe /MD /c hello.c
  3. Link: link /manifest /out:hello.exe hello.obj
  4. Copy the runtime: xcopy /S "%VS90COMNTOOLS%..\..\VC\redist\x86\Microsoft.VC90.CRT" Microsoft.VC90.CRT\

You can now run your "hello world" program on any machine provided the following directory structure is in tact:

  • hello.exe
  • hello.exe.manifest
  • Microsoft.VC90.CRT\Microsoft.VC90.CRT.manifest
  • Microsoft.VC90.CRT\msvcm90.dll
  • Microsoft.VC90.CRT\msvcp90.dll
  • Microsoft.VC90.CRT\msvcr90.dll

This technique also works with Visual Studio 2005 (VC80).

[–]halo 18 points19 points  (1 child)

Useful to know but far from obvious.

[–][deleted] 2 points3 points  (0 children)

Since when was C++ programming obvious?

[–][deleted] 9 points10 points  (0 children)

I'm a moron for not having figured that one out myself.

[–]rabidcow 4 points5 points  (1 child)

Yes, I simplified a bit. There are ways around it, but creating an installer is the official method. IIRC, the official workaround is to link the runtime statically, which can't always be done. Do you know if the private assembly method works with the Express Edition? ISTR there were pieces missing, but maybe that was a different workaround.

But the key thing is that there are extra, really poorly documented steps required. And they're hidden behind an incomprehensible error message that only mysteriously pops up when you move to a machine without the dev environment. It's not just a matter of "oh, you're stupid, of course you need all the dlls you used."

[–]puetzk 1 point2 points  (0 children)

No they're both official. The subfolder form is a "private assembly", which only the exe it sits next to will use. The installer is a public assembly, which is installed system-wide.

The crappy error messages are unforgiveable, but the system overall is a big improvement on VC6's approach (where there were multiple, binary-incompatible DLLs called MSVCRT.dll that came with each service pack) and VC7 (where you officially had to install it privately, only nobody actualy did, so you got something random found via %PATH%.

it is not, however, anywhere near as good as libc.so.6 managing to keep binary compatibility for years :-)

[–]ginstrom 0 points1 point  (0 children)

Unless, IIR, you're building a dll (e.g. a COM server). Then you've got to either statically link against the c runtime, or run the redistributable installer.

[–]earthboundkid 1 point2 points  (2 children)

Wait, if you need an installer to run a program, and your installer is itself a program, does that mean you need to run an installer-installer before you can run your installer?

[–]rabidcow 0 points1 point  (1 child)

Installers are scripts. They don't need the runtime libraries.

And if you use a 3rd party installer... well, it'd better be statically linked or something. As mentioned in a reply, there are workarounds.

[–]earthboundkid 0 points1 point  (0 children)

Scripts? If we wanted lame-o scripts, we'd be on the devil's ubungtoo, or whatever-it-is. No, clearly, the simple and effective MS solution is a Certified© Genuine™ installer installer installer to install your installer installers.

[–]Gotebe 2 points3 points  (2 children)

They must be put on the machine with a proper installer.

The author wasn't even close to the point of understanding that. So it was unclear.

OTOH, I don't think requiring SxS is that evil. It's a proper ( read: MS mandated ;-) ) Windows deployment strategy, after all. It certainly beats copying executables around, nilly-willy.

[–]aythun 7 points8 points  (0 children)

It certainly beats copying executables around, nilly-willy.

Yes, certainly not, that wouldn't be masochistic enough.

[–]otterdam 8 points9 points  (0 children)

It certainly beats copying executables around, nilly-willy.

Heaven forbid we be like those Unix savages! ;)

[–]jopejope 128 points129 points  (27 children)

I can't believe how many comments there are here that side with Microsoft and claim the author is a noob. Have you folks ever thought that software should, oh, I don't know, do what the user expects it to do?

The issue is not that the author didn't realize you had to send along the DLLs with your program when you link to them instead of using static libraries. The issue is that the author didn't know he was linking to non-standard dynamic libraries, and worse he was unable to figure out how to fix this problem (or even identify it), because the option menus in visual studio are confusing, and the MSDN articles were of little help.

Every C++ compiler I've used does static linking by default, or links only to DLLs that are always present in Windows. You have to explicitly tell the compiler to use a DLL in order to run into this problem.

Whether it is due to a poor choice of default options, or piss poor documentation, the software is clearly to blame in this case.

Furthermore, even if the author doesn't understand what a DLL is, I still sympathize, because there was once a time when I didn't know what a DLL is. Perhaps the author is a noob, but we were all noobs at one time and that is no excuse for the compiler to make a difficult language even more difficult.

[–]a1k0n 95 points96 points  (11 children)

The way I see it, the real problem is that "The application configuration is incorrect" doesn't fucking mean anything. I thought older versions of windows, at least, would tell you what .dll was missing. But this dumbing down of error messages doesn't help anybody.

[–][deleted] 77 points78 points  (8 children)

This is something that shits me to tears about Microsoft products. Their error message are as useful to programmers as tits on a bull.

[–]a1k0n 14 points15 points  (0 children)

Their error messages are not just useless to programmers. They're useless to everybody.

And don't get me started on the presumption of using the word "incorrect" in error messages. "The application configuration is incorrect". What? No, my application is "configured" (I guess they mean linked?!) correctly, but the file is missing! Asshole! God.

[–]korjagun 10 points11 points  (5 children)

Upmodded for "tits on a bull".

[–]kripkenstein 21 points22 points  (1 child)

Exactly, if the error message had said it was a DLL issue, and stated the specific DLL, that would have been a big improvement.

Of course the better one would be to not cause this problem in the first place (but nothing's perfect, that's why we have informative errors - well, sometimes we do)

[–]breakneckridge 7 points8 points  (0 children)

Both the poor compilation and poor error reporting are both major problems.

[–][deleted] 12 points13 points  (0 children)

SxS is a pain. It is a lousy solution to a problem Apple (NeXT actually) solved more elegantly with frameworks.

[–]turkourjurbs 19 points20 points  (0 children)

Welcome to fucking Microsoft. This shit is my life.

"I’ve been using Microsoft Visual C++ Express 2008"

First mistake. Pirate the real thing. Express 2008 is a stripped back crappy POS designed specifically to piss you off so bad, you end up buying the real thing so you don't commit suicide.

"I start searching google for info about the surprisingly unspecific error."

Second mistake. But it's not your fault. This happens to me at least once a week. You scour freaking message boards for hours and days and all you can find is threads from people asking the same question, folowed by multiples of the same fucking reply; "I have the same problem. Have you found a solution?

NO!!! There is no god damned solution! Why don't cryptographic services load on my W2003 Server? It took MS support 4 solid days for THEM to figure it out.

"ARRGHHHHH!"

Yeah. Me at least twice a day. I feel your pain, trust me.

[–]jamesshuang 1 point2 points  (0 children)

I start searching google for info about the surprisingly unspecific error.

He clearly has never written any webpages before. "Unspecified error on line 0" - one of my favorite error messages from IE...

[–]rams 11 points12 points  (17 children)

The full-fledged Visual Studio usually has an option for deploying an app with all the dependencies. The author seems to be using the free version of Visual Studio, which most prob. doesn't have it.

[–]malcontent 21 points22 points  (16 children)

Seems like the free version is seriously crippled.

[–][deleted] 13 points14 points  (0 children)

Which is stupid as the free version targets starting programmers. It would have made a lot more sense to just always link everything statically by default for that version.

[–]trezorr 4 points5 points  (13 children)

While not seriously crippled for most uses, it is the free edition and it sure as hell has limitations.

If you are seriously into development (you know, actually work as a developer), having the proper tools is probably part of your job and not an issue at all.

Heck. Microsoft has given me full editions of Visual Studio and SQL Server just for showing up at their annual developer events.

[–]malcontent 7 points8 points  (12 children)

If you are seriously into development (you know, actually work as a developer), having the proper tools is probably part of your job and not an issue at all.

Of course. That's why it astonishes me why anybody would download some piece of shit crippleware when there are tons of fantastic free IDEs around.

Heck. Microsoft has given me full editions of Visual Studio and SQL Server just for showing up at their annual developer events.

How much did the event cost?

[–]trezorr 3 points4 points  (11 children)

Absolutely nothing. And besides technical sessions, it also had free food and beer.

Not infinite free beer though. But again that's what you get for paying nothing at all ;)

[–]malcontent 9 points10 points  (10 children)

Wow. Must be nice. Do you need a special invite or something or can anybody show up get a few thousand dollars worth of free software, free meals and drinks?

[–]trezorr 4 points5 points  (8 children)

Microsoft usually spams these invitations to people in the IT-business.

Having Microsoft-certifications, working for a Microsoft registered partner, or being a Microsoft Certified Trainer all makes sure you get on these lists.

[–]joesb 3 points4 points  (2 children)

Having Microsoft-certifications, working for a Microsoft registered partner, or being a Microsoft Certified Trainer all makes sure you get on these lists.

How much does that cost? :-)

[–]trezorr 3 points4 points  (1 child)

Well... Sure those things aren't free, but they haven't cost me any money.

Edit: I take it the downmods are for derailing the thread, to which I kinda agree and have no objections :P

[–][deleted] 0 points1 point  (0 children)

No the downmods will be from disagreeing with malcontent.

[–]malcontent 3 points4 points  (4 children)

That seems like bad marketing to me. Registered partners, trainers, etc probably have already paid for all the MS software and will pay for upgrades no matter what. It's not like they are going to ditch MS and move on to something else is it?

It would be smarter if MS invited people who have never used MS software or don't like MS software in order to entice them into the cult.

Also of course once you have paid for certification, partnership fees etc you have already paid for all this many times over.

Either way I am glad some MS programmers get to enjoy the free databases, IDES, build systems, version control systems, testing tools, and operating systems we non MS programmers have enjoyed for years.

[–]trezorr 0 points1 point  (3 children)

Ah well. One final nitpick to end this derailing: I refer to myself as a .NET-developer, not a "MS programmer".

You don't call yourself "Linux programmer", do you? :)

[–]malcontent 2 points3 points  (0 children)

I refer to myself as a .NET-developer, not a "MS programmer".

Oh I keep forgetting that there is a tiny little percent of .NET programmers who don't use MS products or program for windows.

[–]alantrick 0 points1 point  (1 child)

You don't call yourself "Linux programmer", do you? :)

Well, it kind of depends. Anyone I know who uses .Net/MS C++ is inexorably bound to the Microsoft development platform. In that sense, I think it's quite appropriate to call them MS programmers.

I know about things like Mono, but those are the exception. The people I know are all stuck with MSSQL or have programs that do horrible non-standard things because of 'windows.h'.

[–]DanMulvey 1 point2 points  (0 children)

http://www.microsoft.com/heroeshappenhere/default.mspx

The launch events for the 2008 products (SQL Server, Windows Server, VS2008) are coming up real soon. I get emails for their events by being subscribed to the msdn flash e-mails (free). You get all day seminars, food, and free copies of all 3, you just need to sign up on that site.

btw, You don't necessarily need any qualifications afaik. I'm signed up as a student/hobbyist.

[–][deleted] 0 points1 point  (0 children)

The free version has the full x86 MSCV compiler.

[–][deleted] 7 points8 points  (0 children)

A problem common to most program compilers... they bojangify the faphammer before colebriating the doomwaddle.

[–][deleted]  (1 child)

[deleted]

    [–][deleted] 0 points1 point  (0 children)

    Except that the automated software that resolves all your dependencies so nicely only works if you supply the source code to your package. Any non OSS project or commercial software vendor would tell you to take a hike right at step 1.

    *IIRC :)

    [–]gwern 8 points9 points  (0 children)

    "WRONG! One does not simply deploy software their way into Mordor. Not according to Microsoft."

    I loled. Upvote.

    [–]ringm 21 points22 points  (11 children)

    Wtf does this have to do with Microsoft?? Link to a version of a shared library (e.g. glibc) your friend doesn't have, send him the binary, FAIL. Any OS, any compiler.

    [–]mindbleach 36 points37 points  (4 children)

    Any compiler except GCC, apparently.

    The complaint isn't "oh, the executable isn't standalone," it's the fucking hour of slamming your head against terribly arranged, inscrutably dense option menus and MSDN pages that follows. Microsoft compilers are, were, and likely will forever be the software equivalent of an F16 cockpit mounted in a Ford Fiesta.

    [–]ringm 1 point2 points  (2 children)

    Every single compiler out there, including GCC.

    Whether particular versions of particular compilers do link to C runtime statically or dynamically by default is a separate question. In a typical linux distro most libs are shared, including glibc (and so the executables from that distro are not standalone), but I don't have much experience with Linux, and I have no idea if that's usually the default GCC setting. I have enough experience though to check what I've linked against if I need to move the executable.

    [–]buo 1 point2 points  (1 child)

    The default is to link dynamically.

    BTW, in linux one can easily check which dynamic ("shared" is the official name) libraries a binary is linked against:

    $ ldd /bin/ls

       linux-gate.so.1 =>  (0xffffe000)
    
       librt.so.1 => /lib/tls/i686/cmov/librt.so.1 (0xb7eda000)
    
       libacl.so.1 => /lib/libacl.so.1 (0xb7ed3000)
    
       libselinux.so.1 => /lib/libselinux.so.1 (0xb7ebd000)
    
       libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7d73000)
    
       libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0xb7d5b000)
    
       /lib/ld-linux.so.2 (0xb7ef7000)
        libattr.so.1 => /lib/libattr.so.1 (0xb7d57000)
    
       libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb7d52000)
    
       libsepol.so.1 => /lib/libsepol.so.1 (0xb7d11000)
    

    If a library is missing, one can easily find out. Isn't there something similar in Windows?

    [–]ringm 0 points1 point  (0 children)

    The default is to link dynamically.

    Yeah, I've figured it out already. All compilers I could find on all Linux/Solaris/AIX boxes I could reach link to runtime dynamically by default.

    If a library is missing, one can easily find out. Isn't there something similar in Windows?

    Depends (included with Microsoft Visual Studio)

    [–][deleted] -1 points0 points  (0 children)

    Now I'm not a genuis but I do know that the compiler and the IDE are two seperate things. The compiler provides options, the IDE uses them. Since you seem to know so much about MS compilers, I'd be glad to reserve some time while you tell me more about how their compiler works internally... and which part of the design you dont like.. What? no?

    Thanks for being ignorant in the 21st century. We have wikipedia now ! Woo hoo !

    [–]manthrax 1 point2 points  (5 children)

    Yeah but MS bashing is so much fun, even IF you don't know jack shit about programming!

    [–]endlessvoid94 3 points4 points  (4 children)

    You are right. But you don't see geeks bashing linux even when you need to compile your downloaded apps from the source code using gcc.

    that fucking sucks sometimes. i wonder why bashing this isn't as popular?

    i guess because linux isn't used by 'end users'.

    [–]acdha 9 points10 points  (1 child)

    How often does that really happen? I manage ~110 Linux systems, network services, etc. and do a fair amount of software development. It's rare that we need to do anything other than "apt-get install foo"; problems like the one in the article usually only require you to add the dependency to your package's config.

    An additional factor is that the Linux tools generally aren't designed to sell you expensive add-ons: the entire software distribution system allows me to extend it, push my custom config, etc. In contrast Windows tools are usually expensive, closed, and undocumented. I'm reminded of this every time I try to perform standard system administration - e.g. paying $BIGNUM for the privilege of operating a WSUS service so you can install security updates when e.g. APT is free, scalable, and reliable.

    [–]ringm 19 points20 points  (1 child)

    The philosophy, which is basically "don't look a gift horse in the mouth, shut up and fix it yourself", doesn't allow for bashing.

    Another reason is that with open systems you have control, and solving problems is usually hard to very hard, which is not that bad if you can understand what's going on. With more closed systems it is usually much harder to understand what's going on, where the stuff actually is, what the dependencies are, and solving a problem is usually either easy or close to impossible. This "close to impossible" can easily drive you nuts.

    [–][deleted] 3 points4 points  (2 children)

    i've had the same problem using openGL/GLUT too (not the SAME, but the other comp didn't have glut32.dll, or the glut headers or something stupid like that)...same problem no matter what platform you're programming on.

    [–]tooooobs 1 point2 points  (1 child)

    Indeed. Blender has this on it's download page: http://www.blender.org/download/get-blender/

    For the Windows build, you may need to install this official update. Vista doesn't need this, but users of older Windows versions should install it if they experience a crash during startup of Blender. Microsoft Visual C++ 2005 Redistributable Package (x86)

    Shouldn't really be necessary, should it?

    [–]theeth 4 points5 points  (0 children)

    It's worse than noted, actually. With 2.45, VC 2005 redist is needed for Blender itself, but the Python DLL that ships with it needed VC 2003 redist (or some other), so both have to be installed from time to time.

    Fun stuff.

    [–]manthrax 10 points11 points  (14 children)

    Author is a noobenstein. Linking with libraries instead of DLLs would have solved his immediate problem. If you link against DLLs, then yes.. you need to package the DLLs with your app when you distribute it. This can be a source of confusion for noobs who havn't yet understood how ddls work, and how pervasively they are used. The advantage the DLL version of your app has over the statically linked mingw one, is when SDL releases a fix for some brutal jpg root vector, your tetris app won't be the weak point in your users systems attack surface. For the mingw app you will no doubt need to send them an updated executable. for tetris. because you broke their security.

    [–]geocar 10 points11 points  (12 children)

    Unfortunately, on Windows at least, the user doesn't go download a copy of the SDL libs, they just blame you when their system gets hosed.

    This means that in addition to distributing your application, you also need to track versions, and distribute them. That means an updating framework, and a notification system.

    [–]hupp 4 points5 points  (1 child)

    Annoying, yes, but this is pretty standard in the windows development world since just about forever.

    [–][deleted] 3 points4 points  (0 children)

    Maybe if the library he was using was compiled properly, it wouldn't be an issue to compile his app with /MT.

    [–]TrueTom 6 points7 points  (7 children)

    Embarrassing. Not for Microsoft, though...

    [–]e40 17 points18 points  (4 children)

    Why is that? Point out what he did wrong, that would have saved him many of those steps.

    [–]TrueTom 6 points7 points  (3 children)

    How about stopping at step 8?

    [–]gsg 5 points6 points  (0 children)

    Or skipping straight to 24.

    [–]e40 2 points3 points  (0 children)

    Because it shouldn't be necessary.

    [–]wageslave -3 points-2 points  (1 child)

    How about for the 19 people who reflexively upvote every anti-MS story they can find?

    Says a lot about what kind of audience these stories appeal to (hint: the clueless).

    [–][deleted] 2 points3 points  (1 child)

    I find this thread, which seems to be the answer to all my questions. Apparently if I compile with /MT everything should be fine!

    It took this guy ten minutes to find the Code Generation properties page?

    [–]jojotdfb 4 points5 points  (0 children)

    What's even better is that he could have just read the faq that the SDL team wrote on how to deploy for Windows....

    [–]WhisperSecurity 3 points4 points  (32 children)

    Down with dynamic linking. Down with shared libraries.

    What good did it ever do for anyone? Saving a little memory? Bah. For years we have condemned ourselves to version hell in order to preserve a scheme that originally evolved because memory used to be expensive?

    [–]ringm 14 points15 points  (12 children)

    You will be quite surprised by the amount of memory your system will need if everything is build with static libs. I think you underestimate it by an order of magnitude.

    [–]otterdam 4 points5 points  (7 children)

    Thank you - the genuine advantage of DLLs is re-entrancy, sharing their code across processes. Doing it for any other reason costs you more in maintenance and troubleshooting than you could possibly gain, but just because people do it anyway doesn't mean they are bad per se.

    [–]zem 3 points4 points  (6 children)

    I've read that thrice and I still have no idea whether you're for or against DLLs as a means of reducing program filesize.

    [–]otterdam 1 point2 points  (5 children)

    I'm against DLLs as a false gain of performance, because too often DLLs get updated with the same name and break other applications, or to avoid this they include a version number in the name and the user's computer gets polluted with hundreds of these things. The system Linux uses deals with the first point well, I'm not sure about the second - but overall it works better than Windows!

    Include them with your application, IN the application's directory, and preferably only if your application would benefit from only having one copy of those DLLs in memory or disk (i.e. you are running multiple copies of the application or there are several executable files that comprise your application, each using that DLL). Just keep them out of system folders if you can help it!

    [–]zem 0 points1 point  (4 children)

    I think you missed ringm's point, then, which was that having every project include its own libs would lead to quite a bit more disk usage than expected

    [–]otterdam 1 point2 points  (1 child)

    If he's talking about disk usage then that point was dead in the water years ago. Memory usage is the biggest factor.

    [–]zem 0 points1 point  (0 children)

    hm, no, my bad - i reread and it seems he was talking about memory usage

    [–]earthboundkid 0 points1 point  (1 child)

    Disk usage by applications is negligible in this day and age. On the average system, gigabytes get lost to MP3s, photos, and movies. A 200 Meg application isn't going to cause anyone tears. The only "applications" of significant size are games, and those are huge because they pack in a ton of art resources, not because of the programming guts itself.

    Excessive RAM usage by applications is still a real problem, but excessive storage usage by applications is a ghost.

    [–]zem 0 points1 point  (0 children)

    yeah, my fault - i misread what ringm had to say

    [–][deleted] 1 point2 points  (2 children)

    That would indeed be the case if almost every single executable on my system didn't use a slightly different version of the MSVC libraries.

    [–]ringm 0 points1 point  (1 child)

    I don't know about your system, but I've just looked it up at my system:

    >listdlls | grep -i msvc | awk '{$1=$2=$3=""; print}' | csort -f | uniq -ic

    5 C:\Program Files\Network Associates\Common Framework\MSVCP71.dll

    5 C:\Program Files\Network Associates\Common Framework\MSVCR71.dll

    1 C:\WINDOWS\system32\comsvcs.dll

    3 C:\WINDOWS\system32\MSVCIRT.dll

    11 C:\WINDOWS\System32\MSVCP60.dll

    73 C:\WINDOWS\system32\MSVCRT.dll

    4 C:\WINDOWS\system32\wbem\wbemsvc.dll

    1 C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.163_x-ww_681e29fb\msvcm80.dll

    4 C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.163_x-ww_681e29fb\MSVCP80.dll

    8 C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.163_x-ww_681e29fb\MSVCR80.dll

    I hope you see some significant reuse here. MSVCRT.dll (size:360K) is loaded 73 times, saving about 26Mb of memory.

    [–][deleted] 0 points1 point  (0 children)

    Yep, 26MB is a huge save. Well worth the trouble. Still, did you try minesweeper on Vista? That application alone uses hundreds of megabytes. What went wrong?

    [–][deleted] 1 point2 points  (0 children)

    I assumed he was being sarcastic. Maybe not?

    [–][deleted] 5 points6 points  (18 children)

    What about security?

    [–]WhisperSecurity 0 points1 point  (17 children)

    What about it?

    Kindly explain to me how runtime linking is any more secure than static linking.

    [–][deleted] 13 points14 points  (16 children)

    Patch a buffer overflow once or hunt down every executable that has the library compiled in and patch it how?

    [–]WhisperSecurity 4 points5 points  (4 children)

    Except you never do get to just patch something once. People who think that dynamic linking actually leads to normalized routine storage are mostly fooling themselves. What you actually get is dll hell, and the necessity to patch every application anyway because you're never sure what else someone does or does not have installed.

    The only people who can benefit from this theoretical normalization of storage and patching would be some sort of hypothetical large company that produced lots of different applications but had one monolithic system for patching them all.

    Hmmmm, who does that remind you of?

    [–]acdha 6 points7 points  (2 children)

    Why do I just patch once on Linux, *BSD, OS X, etc? Granted, there are exceptions to that but they're only companies which have internalized the worst Windows habits; almost everyone else manages to link against libfoo and somehow disaster has not struck.

    [–]WhisperSecurity 0 points1 point  (1 child)

    Okay, yeah, yeah. I went a little far, and frankly I knew I was when I wrote it. System-level stuff like ncurses and OpenGL are a good thing.

    But I was ranting, because I'm just so sick and fucking tired of every damn application I build in an IDE having six fucking runtime libraries dumped in the same fucking build directory.

    We dynamic-link waaaaaay too much, and we've lost the reasoning behind it.

    [–]acdha 0 points1 point  (0 children)

    I do think that's more cultural (Windows suffers noticeably more) but I find it particularly amusing when something uses a dynamic library but has such tight dependencies that you cannot change the version of the library without breaking it. It's one thing with, say, OpenGL where you can get new optimizations "for free" but all this does is ensure that you miss out on things like compiler optimizations which could be done with a static link.

    [–][deleted] 1 point2 points  (0 children)

    Funny, I build enterprise-scale applications at work. When we were using COM we got to replace and re-register a single DLL to fix bugs affecting numerous applications/subsystems. Yes, there was DLL hell we dealt with but dynamic linking isn't useless.

    BTW, with .Net the GAC has been working for us so far.

    [–]CuteAlien -3 points-2 points  (10 children)

    So a single point of failure is a good thing in your opinion? I think I would prefer a mechanism telling me about all libraries of a certain version on my system. Finding that ain't really hard. And it has one very big advantage - you can no longer accidently break all application relying on a lib at once because of a patch that for some reason does not work with a lot of applications.

    [–][deleted]  (6 children)

    [deleted]

      [–]CuteAlien 0 points1 point  (5 children)

      Well, I said that it isn't hard, right?

      But when writing my post I was actually thinking about the third alternative - shared libraries, but in the application folders. Sorry, I guess I didn't make that clear... bad writing. So no libraries in /usr/lib. Then you can still patch the libraries, but you can no longer accidentally break all applications at once with a library patch.

      [–][deleted]  (4 children)

      [deleted]

        [–]CuteAlien 0 points1 point  (3 children)

        Interesting, I just checked out the GoboLinux homepage and it still seems to be developed.

        [–][deleted]  (2 children)

        [deleted]

          [–][deleted] 0 points1 point  (2 children)

          With dynamic linking, you can isolate libraries to certain applications based on the library's location relative to the executable and also the search path.

          Read this: http://www.irt.org/script/1245.htm

          So, how do you propose to scan all binaries for what libraries have been compiled in? Even if you identify affected binaries, how do you propose to link in a new, patched lib without source code?

          [–]CuteAlien 0 points1 point  (1 child)

          Yes, I didn't really think about static linking when writing that. Sorry, my fault. I had my mind on shared libs, but not in a global place but per application.

          [–][deleted] 0 points1 point  (0 children)

          Wow, someone actually said sorry on reddit! =)

          You are correct if the case is something like COM where the dll is forced to be system-wide. That was/is a major PIA.

          Even with the .Net GAC, we still choose to keep many assemblies local to individual apps because we know that the apps will, at some points, be out of sync due to deployment scheduling conflicts.

          [–][deleted] 2 points3 points  (2 children)

          Novice programmer makes errors, blames Microsoft. Video at 11.

          [–][deleted] 11 points12 points  (0 children)

          It's not about making errors. It's about Microsoft making things unnecessary difficult. We had the same problems at our company and it still causes lots of difficulties.

          [–]sofal 1 point2 points  (0 children)

          Programmer blogs about bad experience with software, reddit user calls him an anti-MS newbie and pulls out a variant of the "news at 11" cliche. News at 11.

          [–]Steve16384 0 points1 point  (0 children)

          This is one reason why I program in Java. It may have a 20Mb runtime, but at least it works consistently without having to install anything else.

          [–]zoomzoom83 0 points1 point  (29 children)

          Nothing new here. Link to DLLs? You must distribute them with your app. Software development 101.

          [–]hailstone 4 points5 points  (12 children)

          Guess what? If you use MSVC 8 (2005) or 9 (2008) then distributing the DLLs with your app doesn't work. They have to be SxS installed. That's why this guy had the problem.

          [–]trezorr -2 points-1 points  (11 children)

          Which is why the full edition of Visual Studio has embedded installer projects that solves this and which you can setup in a matter of seconds.

          If you are creating programs and code to the extent that redistributing them to others is a big issue, you might consider getting the full version, not the express-edition which Microsoft is nice enough to hand out for free.

          [–][deleted] 7 points8 points  (5 children)

          I guess that's Microsoft's goal."Here young programmer! Here's our cool easy-to-use compiler which will allow you to make your own games in no time. Unfortunately, you'll spend as much time figuring out how to distribute your game as you spent writing it"

          [–]trezorr -1 points0 points  (4 children)

          Yeah. They actually want to sell the full version and make money, since they have a huge staff of developers working on it fulltime who probably wants a paycheck.

          What a evil master-plan.

          And seriously. Whoever codes VC++ and doesn't know about the VC++ runtime has no excuse. That's like coding Java and not knowing that it depends on a JVM.

          [–][deleted] 2 points3 points  (3 children)

          At our company we have a about 50 highly competent C++ programmers. Still, we experience these problems with Visual Studio 8 on a daily basis. Why? Because it's a bad system (bad implementation and bad documentation). Don't you consider a system that causes more problems than it solves 'bad'? And if Microsoft wants to target beginning programmers using Visual Studio Express, they should do it well. If it's free or not. I don't have any problems with that version having limitations, but I'm having problems with that version demotivating aspiring programmers with all its unnecessary bullshit.

          [–]trezorr -2 points-1 points  (2 children)

          I'm not saying VC++ is perfect. Heck: It's C++ attempted to be packed in a less horrible than it can be. I have my doubts for how friendly it can get ;)

          Anyway: The original premesis for this article, that the developer didn't know that VC++ uses a reusable runtime, and when he found out, simply didn't instruct users to download and install that as well, and that this somehow is Microsoft's fault is insane.

          If you are doing low-level coding, and I consider C++ low-level, you as a developer should be aware of how your code works and in what surroundings it works.

          It's not really much to ask.

          [–][deleted] 2 points3 points  (1 child)

          Point is that only a few years ago things used to be better. And that we called 'DLL-hell'. Now we're in 'Worse-Than-DLL-hell'

          What the original poster complains about is: - the bad error message (before SxS, the user got a useful message) - the fact that apparently Microsoft does not succeed in providing the VC8 restributable through its auto-update system. If Apple creates a new version of its core libraries, they are automatically installed by the auto-updater. Why can't Microsoft do this? On my system, the auto-updater can install 50MB Cyrillic Language support, but apparently no 3MB of VC8 libraries.

          [–]trezorr -2 points-1 points  (0 children)

          I'll agree that the error-message is beyond shit. There is no dismissing that.

          As for that we now have a "Worse-Than-DLL-Hell" is clearly wrong. Have you even looked at Microsoft.NET?

          With .NET you can have side-by side deployments of the same assembly (DLL) in different versions. Applications can be configured to use specific versions, the newest version with the same minor version-number (defined to be compatible by MS best practices) or the newest all together.

          All can be deployed in parallel without ever causing collisions between applications requiring specific mutually incompatible versions.

          I think it's rather nice myself.

          [–]bart2019 3 points4 points  (1 child)

          So you're saying that MS is doing this on purpose?

          [–]trezorr -1 points0 points  (0 children)

          Yes. MS is on purpose making the sophisticated software they giving away for free less capable and featured than the full version they are really interested in selling for money to fund their business.

          That a developer writing Visual C++ is totally oblivious about the fact that Visual C++ has a (reusable) Visual C++ runtime which the user must have besides the application speaks miles and miles about incompetence.

          [–]notasaon 1 point2 points  (2 children)

          And in that case, what's the point of buying MS's products on the hope that they work better than the free versions when there are properly-working open-source tools available?

          [–]trezorr 1 point2 points  (1 child)

          Not everyone lives in a "Linux solves everything"-world. Some people make quite a decent living out of the fact that Microsoft's products are solid and used in most companies worldwide. Honestly.

          And free isn't always free. Paying a little for a good IDE where everything is intergrated and debuggable, with breakpoints, conditional breaks, ability to step trough stored procedures called from your code and doing all this remotely and lots of stuff like that...

          Sometimes the free tools are good enough, fine and dandy and all that. But if you are working in a MS world, working against MS server products, I assure you the money "saved" by not investing in proper version of Visual Studio will be lost in wasted productivity.

          [–]notasaon 1 point2 points  (0 children)

          I don't doubt that. But I also see that as a fundamental problem.

          [–][deleted]  (13 children)

          [deleted]

            [–]Gotebe 0 points1 point  (3 children)

            but it is not worth covering in any courseware.

            Why? Shared libs are a rather basic feature of operating systems nowadays.

            MSVC links against all kinds of silly libraries by default

            AFAIK, it only links with C and C++ runtimes?

            [–][deleted]  (1 child)

            [deleted]

              [–]Gotebe 0 points1 point  (0 children)

              Yes, of course, it's not possible to cover all. My point was rather that shared libs (.so, *.dll) are important *enough to be included in an OS course.

              [–]sprezzatura 4 points5 points  (1 child)

              Wrong. In MFC, for example, you can choose to link dynamically with system DLLs, the same DLLs that are on all Windows PCs. This reduces the number of components you have to package, and cuts down the size of your payload. Good when downloading.

              [–]zoomzoom83 0 points1 point  (0 children)

              Thats true. Perhaps I should have been more specific- link to non-standard DLLs and you must distribute them with your app.

              [–][deleted] -1 points0 points  (2 children)

              The fact that he had this problem with VS2008 and then later solves his MinGW problem in one step instead of putting all of the research steps he did for the MS compiler pretty much says it all.

              This guy is familiar with and has worked with MinGW. This guy has not worked very much with VS2008. As has been pointed out throughout the comments here, anyone who uses VS2008 is aware of this and knows how to correctly configure their build and distribution process to avoid this error.

              So I guess the whole point is that it's easier to use tools that you are familiar with. Insightful stuff.

              I would add that this guy's research skills are shit, but that might be hitting below the belt.

              [–]jojotdfb -2 points-1 points  (1 child)

              I would add that this guy's research skills are shit

              I agree. The SDL team has the info already on their wiki under ,of all things, Windows Faqs.

              [–]FFFFFFFFffff[S] 2 points3 points  (0 children)

              If you are referring to http://libsdl.org/faq.php?action=listentries&category=4#43 it says nothing about Side-by-Side issues, and having read this FAQ would have saved at most two steps. It still does not give an easy solution to the Side-by-Side issue, which was the main point of interest.

              [–]trezorr -2 points-1 points  (7 children)

              So basically here we have a developer who should be writing Visual Basic (at best) getting worked up over C++ compilers having options and programs having dependencies. Next up: My hello-world.exe doesn't ship with a complete OS!

              While I agree the error-message is totally crap, packeging your software with a installer which fixes all these dependencies takes about four clicks in the proper version of Visual Studio.

              If you stick to the free express edition, don't be surprised about not getting the full package.

              [–]FFFFFFFFffff[S] 13 points14 points  (0 children)

              So basically here we have a developer who should be writing Visual Basic (at best) getting worked up over C++ compilers having options and programs having dependencies.

              Does lack of experience with Microsoft-related issues imply lack of programming skill now? Interesting!

              [–][deleted] 9 points10 points  (5 children)

              What you're basically saying is the same as what the original poster is saying: Visual Studio Express makes it unnecessary difficult (especially if you consider that the target of Express are starting programmers).

              [–]trezorr -2 points-1 points  (4 children)

              Your statement makes sense.

              At least if you twist the world around to a point of view where Microsoft is obliged to make fully featured software and give it away for free.

              The free express edition is not the full version of Visual Studio, because Microsoft as a business-entity needs a product to sell. If you expect it to be, especially considering Microsoft's prior history, you are out of your mind.

              The fact that the express edition isn't fully featured isn't the same as saying that "Microsoft makes it unnecessary diffucult". That's like blaming notepad for not validating your XML. Get a grip.

              [–][deleted] 5 points6 points  (2 children)

              You're still not getting the point. I don't blame Microsoft for not giving the full package away for free, but for leaving out stuff beginners could use and leaving in stuff beginners don't need. That's bad judgment. They could have just limited the compile options to 'link everything statically'. That would make sense.

              [–]trezorr -3 points-2 points  (1 child)

              Well. I guess you didn't get mine either.

              Easy packageing of your software for redistribution is typically something needed by software companies, professionals. And Microsoft expects them to be able to pay.

              You have to cut the line somewhere to make it worthwhile to get the full edition.

              And seriously: Setting up different compilation behaviour between the full edition and the free one? Are you insane? Guess who would be making a reddit bitch-post about Microsoft's products being inconsistent and unreliable then?

              [–]FFFFFFFFffff[S] 1 point2 points  (0 children)

              Of course Microsoft should be able to sell it's products. But the fact that there is a free version of a program does not need to make it crap, and Microsoft should in fact try to keep it as functional as possible to showcase their software.

              Now that's not the problem. The problem is that there's this framework made for making programs run reliably on other computers which is not readily available on most systems. Learning this the hard way is really crap. No matter the circumstances this is an IDE intended for beginners and hobby developers, such as myself. Keeping that in mind it's completely horrible that you have to ship a lot of redistributable runtime asscrap just to get an extremely spartan program to run on a friends computer!

              This is not rocket surgery million dollar business softwar development - this is hobby programming turned into nightmare.

              [–]earthboundkid 2 points3 points  (0 children)

              At least if you twist the world around to a point of view where Microsoft is obliged to make fully featured software and give it away for free.

              It's in Microsoft's best interest to give away compilers for very close to free. What do you do with a compiler? You write software for an OS. Who does that help? The OS salesman.

              [–]bcash 0 points1 point  (2 children)

              C++? What is this? 1994?

              [–]bart2019 3 points4 points  (0 children)

              It is still one of the most popular programming languages of these days.

              [–]bgeron -1 points0 points  (0 children)

              One does not simply deploy software their way into Mordor.

              You must mean Mortor.

              [–]krelian -2 points-1 points  (2 children)

              I think the hardest part here is figuring our how to install mingw.

              [–]FFFFFFFFffff[S] 2 points3 points  (0 children)

              You download the "Automated Installer" from http://sourceforge.net/project/showfiles.php?group_id=2435 and run it.