Slashdot Mirror


Free Optimizing C++ Compiler from Microsoft

FortranDragon writes "Microsoft has made the command line toolkit for Visual C++ available for a free download. You can use the toolkit to build applications and redistribute them if you want (though you should read the EULA for the details, as always). This is a nice boon for those that have to deal with cross-platform compatibility, especially since Microsoft has tried to make Visual C++ more conformant to the ISO C++ standard. Go forth and compile your favorite OSS or FS programs today. ;-)"

64 of 953 comments (clear)

  1. Weird Output by naden · · Score: 5, Funny

    I just tried the following program:

    #include

    main()
    {
    printf ("Hello World!\n");
    }

    And I got the output "Hello Suckers" .. anyone have any idea why ?

    --
    Funtage Factor: Purple
    1. Re:Weird Output by ion_ · · Score: 5, Funny

      And I got the output "Hello Suckers" .. anyone have any idea why ?

      I tried it as well, the bug exists indeed. The \n really was missing from the output.

    2. Re:Weird Output by Anonymous Coward · · Score: 4, Funny
      unless MS's compiler is different than gcc

      No; they're actually just the same compiler, packaged under different names and under different licenses.

    3. Re:Weird Output by Anonymous Coward · · Score: 4, Informative

      I'm fairly sure this behavior is required by the C/C++ standard. The key is to open streams in ASCII mode, rather than binary mode. Because C/C++ are designed to be portable, the standard I/O library is required to convert the line endings (but not in binary mode). Unix's binary mode is equal to its ASCII mode (since it uses \n natively).

      If the standard I/O library didn't understand line endings, then functions like fgets() could never work, and working with strings (where you expect to be able to match against \n) would be much harder.

      Networking is different, since it uses raw I/O, and doesn't pass through stdio's translation layer. Also, you usually want the binary data on the network. :) The Internet mainly uses \r\n as the line ending (although this made sense in the past, why they continue to stick with it in new protocols is beyond me, besides maybe the ability to easily telnet in and type in raw protocol commands by hand).

    4. Re:Weird Output by CabanaBoy · · Score: 4, Informative
      When you fopen() a file in binary ("rb", etc.) mode, you do have to take that into account. However, when you open in text mode ("r", "w", etc.) the stdlib does linefeed conversion for you.

      Here's an excruciatingly detailed explaination.

      Note that fseek() with SEEK_CUR will almost always fail in text mode, since the number of bytes read may vary from the current offset in the file due to the conversion. Recording the current offset with ftell() followed by an fseek() with SEEK_SET will clear that right up.

      Crazy but true. This has corrupted my data more than once. Here's an excruciatingly detailed explaination.

  2. MS seems to be doing a lot of this lately... by Amiga+Lover · · Score: 5, Interesting

    MS seems to be doing a lot of this lately. It's nowhere near as open as F/OSS solutions, but it's freeing up access to what's possible with Windows far more than previously.

    One of the reasons for the success of OSX is the general geek crowd's appreciation of it's *IX background, but without free dev tools that's nothing but another flavour of unix. Add the ability to dive into developing instantly and there's tens of thousands more developers working for the company.

    1. Re:MS seems to be doing a lot of this lately... by Anonymous Coward · · Score: 5, Informative

      just to clarify this Apple's dev tools ARE included, just NOT installed by DEFAULT.

      EVERY new machine SHOULD come with a separate developer's CD just as every boxed version of OSX should. The end user just has to apply some elbow grease in a) noticing this, and b) bothering to install it.

      Also in the unlikely event that the developer CD is not present or there is an upgrade it is ALWAYS available(even to free online developer members) as a download. Hell even the old classic dev toolset(name escapes me at the moment) has been available free since, what?, 1994/5 or so?

      The only commercial environments are things like Codewarrior(Metrowerks), Absoft FORTRAN, RealBASIC, etc. Codewarrior MIGHT be worth it if you are trying to make money as their compilers are proprietary and USUALLY optimize much better than gcc. (I don't think that anyone has done a recent set of benchmarks of Apple's latest improvements of gcc v. current Metrowerks compiler though...) ...and now that I'm thinking of it most OSes of recent years, free AND proprietary seem to come with some sort of gcc based plus IDE dev tools any more anyways, e.g. BeOS, *Linux, *BSD, OSX, MacOS 7.5-9.x etc. On top of this didn't M$ used to have pretty decent pricing(surprisingly) for VC++/dev studio only anyways? (It's been a while since I've bothered to check.)

    2. Re:MS seems to be doing a lot of this lately... by SoSueMe · · Score: 5, Informative

      The very first thing it does is try to configure .net on your machine.

      Since my only Windows machine is 98, it couldn't complete the rest of the install.

      Yes, it is a sacrificial test machine. I just wanted to see the EULA.

    3. Re:MS seems to be doing a lot of this lately... by ReelOddeeo · · Score: 4, Insightful

      EVERY new machine SHOULD come with a separate developer's CD just as every boxed version of OSX should.

      Twenty years ago I would absolutely agree.

      Not today.

      Only one in one hundred, maybe one in one thousand users would do anything with this CD. (And I am counting the users who make clocks or other decorations out of useless CD's.) Don't increase the cost for everyone so that you can have a CD in the box.

      What development tools? What language? What IDE? There are so many to choose from. If the CD doesn't have the right one, then it doesn't do any good anyway. As soon as two (2) of those tools on that CD are out of date, then the CD is perceived to be out of date.

      If developer tools are to be free as in lunch, then why not just make them available for download. This is much cheaper than including a CD with every computer.

      --

      Those who would give up liberty in exchange for security and DRM should switch to Microsoft Palladium!
    4. Re:MS seems to be doing a lot of this lately... by jellomizer · · Score: 5, Insightful

      Well I think Microsoft has found out what the biggest threat to their business. It isn't the quality, security or price of their software that makes them popular. It is and always has been how much software is available for their platform. Since the DOS days up to Win 95 or 98 (I am not sure which) Microsoft always packaged some development software with their OS. Although it was usually just BASIC but still it got people programming for them. After they got their market share they stopped giving away their development software, Then hobby developers who often turn professional developers start switching to Linux and OS X because there are development tools out there for them to program. Now over a long period of time as the old windows software companies merge go out of business, consoled or got bought out, there are less software titles available for windows. And the new programmers out there are programming in Linux and OS X get use to programming in that environment and when they make a professional grade application they release it for that platform. So after a while the software titles available to Linux and OS X could match or exceed that of Windows thus Microsoft will then need to find a way to make up the the long period of time of developers.

      --
      If something is so important that you feel the need to post it on the internet... It probably isn't that important.
    5. Re:MS seems to be doing a lot of this lately... by zulux · · Score: 5, Funny

      One could alomst say that it was developers that drive the sucuess of a operating saystem. Without developers, Linux woulden be anwhere. It's time thank all the Linux and *BSD developers, and GNU developers and other Open-Source developers. We need more Developers! Developers! Developers!

      --

      Moneyed corporations, non-working 'poor' and criminal prisoners are turning productive citizens into tax-slaves.

    6. Re:MS seems to be doing a lot of this lately... by andalay · · Score: 5, Funny

      Perhaps what you meant to say is:

      Developers! Developers! Developers! Developers!Whooooo... Cmon. C-c-c-c-cmon!

      If you don't get it, thats ok too

    7. Re:MS seems to be doing a lot of this lately... by Moridineas · · Score: 4, Insightful

      The page seems to indicate that the .net runtime might be installed on your machine if you execute the download; can anyone who has done it confirm this for me? I don't want to have to drive a wooden stake through my CPU.
      I'm a MCSE, but I would never purposfully allow .net in my house. it activates all my tin foil hat's little buzzers and lights.



      What the hell? Informative? You're afraid of a program library? Do you not have any clue wthat .net is?

      It's users like you that give MCSE's a bad name (and pagan libertarians as well).

    8. Re:MS seems to be doing a lot of this lately... by LetterJ · · Score: 4, Insightful
      While still not free, XP Home can be had for $85 in a full version, not just an upgrade. And that cost only exists if you didn't already buy a computer with 2000 or XP on it. Obviously, you either bought a computer with Win98 on it or bought 98 by itself a few years ago.

      Your complaint sounds like someone griping that some piece of free software (could even be Linux-based) isn't really free because it requires a 600Mhz processor and 128MB of RAM and your old 133/16MB will require a CPU and RAM upgrade to run it.

    9. Re:MS seems to be doing a lot of this lately... by c4Ff3In3+4ddiC+ · · Score: 4, Informative
      What development tools? What language? What IDE? There are so many to choose from. If the CD doesn't have the right one, then it doesn't do any good anyway.

      Just wanted to note. If you install the dev tools on MacOS X, you get perl, python, ruby, c, c++, objective-c, java, php, bash, and probably more right from the start. You even get emacs and vim!

      You also get a nice IDE called Xcode. I don't do much programming so I can't say how nice it really is, but it does the usual project management, debugging, etc that you would expect.
      --
      *twitch*
    10. Re:MS seems to be doing a lot of this lately... by SquadBoy · · Score: 4, Funny

      don't forget power, a desk, somewhere to put it. You need to buy food and something to eat it on/with. My god I hate those bastards. :)

      --

      Cypherpunks: Civil Liberty Through Complex Mathematics. Those who live by the sword die by the arrow.
  3. Not needed by sweet+cunny+muffin · · Score: 4, Interesting

    I develop software for Windows using MinGW and MSys. They provide everything I need for development, apart from the IDE, and this release from Microsoft doesn't include that. The Visual C++ compiler is good, but it isn't extrordinary. Why use it over the open source MinGW tools?

    1. Re:Not needed by Anonymous Coward · · Score: 5, Informative

      There's a decent free IDE available called Dev-C++ for windows, it comes with mingw32 ofcourse.

    2. Re:Not needed by lpontiac · · Score: 4, Informative
      • Microsoft's compiler produces better (smaller, faster) x86 code than GCC.
      • I get the impression that when you move above vanilla C code (eg C++, libraries distributed in binary form only), different compilers don't play so nicely. (Just like gcc 2.9x versus gcc 3.x). And most of the binary only stuff out there on Windows is compiled with Visual C++.
    3. Re:Not needed by tesmako · · Score: 5, Insightful

      Because it starts to feel like I have wasted several years of my life waiting for g++ by now. g++ is probably the slowest compiler I have ever used.

  4. Yes! by Flingles · · Score: 5, Funny

    "tried to make Visual C++ more conformant to the ISO C++ standard"

    Score one for the team! Microsoft conformed to something!

    --
    Karma: -2^0.5 . Mainly due to the imbibing of dihydrogen monoxide
    1. Re:Yes! by nukey56 · · Score: 4, Funny

      Seems firmiliar.. ahh yes.

      Goth Kid #3: "I'm the biggest non-conformist!"
      Goth Kid #4: "I'm such a non-conformist, that I'm not going to conform with the rest of you. I'll do it!"

  5. platform SDK by halfdan+the+black · · Score: 5, Informative

    The platform SDK which includes the command line compiler, linker and debugger has allways been a free download (hasn't it). Also, the .net SDK which includes all the languages, libraries, and compilers has also allways been a free download, this is what sharp develop uses.

    1. Re:platform SDK by hobuddy · · Score: 4, Informative

      The command line C++ compiler was never included in the SDK. The C# compiler and so on were, however.

      That's incorrect. The .NET SDK has always included the C++ compiler (installed by default to C:\Program Files\Microsoft Visual Studio .NET 200x\Vc7), but the compiler was the Standard Edition, without an optimizer. If you pass it an optimization switch, the Standard Edition issues a warning to the effect that "The Standard Edition of Microsoft Visual C++ does not include an optimizer.". Naturally, lack of an optimizer makes the Standard Edition almost useless for production code.

      This newly released command-line compiler includes a fully functional optimizer. It's the same C++ compiler that underlies VC++ .NET 2003 Professional.

      --
      Erlang.org: wow
  6. Re:My experience with VC++ by sweet+cunny+muffin · · Score: 5, Insightful

    So you write shit code that doesn't fit the standards ("liberal" code), your shitty compiler doesn't notice and compiles it anyway, and then it's Microsoft's fault when their standards conforming compiler won't compile it?

  7. Clippy's response to compiling OSS by foidulus · · Score: 5, Funny

    Clippy: "It looks like you are trying to compile the gimp, did you know the GPL was written by Carl Marx, you don't want to be un-American do you? If you need help embracing capitalism, please ask me."

  8. crack is free first time by mabu · · Score: 4, Interesting

    This looks like an aggressive effort to get people to start developing .NET apps since a major part of the free download includes support for .NET.

    One has to assume MS is worried they're losing their development community to run a scheme like this.

    1. Re:crack is free first time by mattgreen · · Score: 4, Informative

      I know knowledgable comments are looked down on at Slashdot, but the .NET SDK has been free from the start and included cl.exe, (the C++ compiler) but it was the non-optimizing compiler I think. What the .NET SDK didn't have was the full STL and a few other things that are now free.

      The end-result of this is everyone gets a free compiler upgrade if they haven't moved to VC7.1 already. It means on my OSS project I can say "VC7.1 minimum," and expect everyone can follow suit without a problem. However I realize this isn't as fun as tin-foil explanations, so I'll let you get back to that.

  9. EULA? by nukey56 · · Score: 4, Interesting
    From linked site:
    Are there any restrictions on how I use the Visual C++ Toolkit?

    In general, no. You may use the Toolkit to build C++ -based applications, and you may redistribute those applications. Please read the End User License Agreement (EULA), included with the Toolkit, for complete details.

    From the EULA.... Oh wait, I'd have to waste half an hour downloading the compiler to read it. I'm sure there's an evil clause in there. Best thing I could find relating to VS.net runtimes was this old gem:

    You may not disclose the results of any benchmark test of the .NET Framework component of the OS Components to any third party without MicrosoftÃÂ's prior written approval.

    Use at your own discretion.
  10. Re:My experience with VC++ by startup.cmd · · Score: 5, Informative
    Anyone know where to get a free visual debugger for Win32?

    MS provides the Debugging Tools for Windows as a free download. GUI and command line debuggers are included.

  11. How about some evidence? by enosys · · Score: 4, Insightful

    I was going to ask about "why get this if there's MinGW" but I see it's already been asked. I suspected someone would say Microsoft's compiler produces better code. Now where's the evidence? I'm looking for something like independent benchmarks or studying of generated code.

    1. Re:How about some evidence? by man_of_mr_e · · Score: 4, Informative

      This is a few years old (as are most of the benchmarks i've seen) but you can try this http://www.willus.com/ccomp_benchmark.shtml?p11

      Note that this is comparing MSVC 6 (current version is 7.1, and it's improved a lot). In this test, Intel beats everyone, MSVC comes in second with MingW third, however, both the Intel and MS compilers have improved massively in the last couple years. I don't know about MingW. At least part of MingW's success is that they use MS's runtime library, which means that a great deal of the code being run was compiled by MSVC.

    2. Re:How about some evidence? by Anonymous+Brave+Guy · · Score: 4, Informative
      I suspected someone would say Microsoft's compiler produces better code. Now where's the evidence?

      There are at least two easy answers to that question:

      • Look at the disassembly for any reasonably complex algorithm, and spot all the platform-specific optimisations that VC++ (and indeed most other commercial compilers on Windows) perform that GCC (due to its portability requirements) does not.
      • Use Google, and look for people who've compared the real world performance of non-trivial apps built with each compiler. (You might do better with Google Groups than the Google web search engine on this one.)
      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    3. Re:How about some evidence? by Too+Much+Noise · · Score: 4, Informative
      heh - benchmarking, gotta love it. Here's a clue about (more recent) compilers - note that the bench you linked to has what would be a 5-gen-old gcc (2.7.x). even 2.9* used to spank MS' cl 13.x (that's the pre-release versions of 7.0 that were also freely downloadable - in fact, MS used to give away compiler toolchains for a long time as part of the SDK, old news, huh?).

      1. recent icc (7.x, 8) spank about everyone on vector fp due to various reasons (like Intel not releasing a full spec of the SSE2 unit - check out the gcc mailing lists about SSE2, you'll see they didn't have info on timings and so on, hence gcc does only some integer optimization and mostly scalar fp).

      2. icc does some (nice when not useless) automatic parallelization of code (the idea being to use hyperthreading better).

      3. gcc 2.9x -> 3.1+ was a big improvement as well (moreso for 3.2+, check the docs for the new way they do the machine description for scheduling). Just check your own link.

      4. -ffast-math on gcc only has it do what both Intel and MS are already doing - using the bloody fp unit instead of software emulation!!! (easy proof - do an asm dump of the generated .o file).

      5. another big thing that's done by default by icc and cl is the gcc flag -fomit-frame-pointer (which on x86 is quite important due to register starvation). Again, gcc has that missing.


      Actually, looking at the compiler flags makes me wonder whether there's any point in taking those bench's seriously - the guy didn't even bother to use anything more than -mcpu=i686 (aka 'generate for pentium pro) for gcc, and the other compilers' switches are still close to minimal (even if they mean quite more than the gcc one). Makes one wonder about how competent the guy doing the benchmark was.
  12. Suits me just fine.. by multipartmixed · · Score: 4, Interesting

    ...I've been using MS VC and eVC to build code under Winblows and Wince for a long time. I use GNU make under Cygwin with a bunch of fancy default rules.

    Having this compiler released means that
    a) I don't have to install that confusing GUI
    b) I don't have to cough up the money to upgrade (Currently running VC 5.0) ..the MS compiler is actually not that bad, and you're stuck with at least *SOME* MS tools if you want interoperatibility with other MS tools. MIDL interfaces (formerly ODL), for one.

    I write library code under UNIX in C, debug it in a sane environment (100% GNU, except for Xemacs) and then port it to Windows (generally pretty trivial -- I port by making Windows look like POSIX, so the UNIX codebase stays basically virgin). Run it through MIDL to get a type library, and all of a sudden your stupid VB developers developing one-off, simple GUIs have access to all kinds of well-debugged code that was originally developed on a sane platform.

    As long as your code only touches files or sockets, it will run okay under MS VC.

    --

    Do daemons dream of electric sleep()?
  13. Re:goes both ways... by Waffle+Iron · · Score: 5, Funny
    CC was the most liberal of them all, it would complile and run your email.

    This highlights once again how Windows is a more flexible and modern development platform than Un*x. With Windows, email can be run automatically and remotely, without the need for a separate compilation step.

  14. It makes as much sense as Linux... by aksansai · · Score: 4, Insightful

    Give Linux away for free - they will come. Same principle applies.

    If you bothered to download the .NET Framework SDK (even back to Version 1.0) it included a fully functional compiler that allowed you to compile C# applications under the CLR. I believe "cl.exe" was also included, the optimizing C/C++ compiler, with the SDK.

    Giving the compiler away for free MAKES sense. The only free, mature Windows compiler available is GNU's C/C++ compiler. Although I prefer open-source tools for development, I cannot dismiss Microsoft's compiler as being one of of the best optimizing compilers _there is_. Its only major caveat is the fact that it is designed for one platform only - Windows.

    --
    Ayup
  15. Re:Microsoft offers interoperatibility? by Paul+Townend · · Score: 4, Informative

    The "learning edition" of MSVC++ prohibited you from commercially distributing binaries made with it (or perhaps even just distributing the binaries, I can't remember just now). It also displayed a pop-up window whenever you executed your code, reminding you of this.

    However, considering it cost virtually nothing to get the thing, I don't think this was particularly unfair.

  16. Port Anjuta on top of this? by Anonymous Coward · · Score: 4, Interesting

    How about making Anjuta (or other FOSS C/C++ IDE's, like KDevelop?) run on Windows on top of this compiler and provide Windows programmers with a free competition to VC++?

    This way - they get to learn to use an IDE which they can also use on Linux, MS's income might get hurt because people don't HAVE to by VC++ to develop for Windows with MS's optimizing compiler (which is excellent, you can't say it isn't).

    Just take this as an advantage for the FOSS community and do something with it, instead of just bitching all day.

  17. The battle is for the hearts/minds of develop by pcause · · Score: 5, Insightful

    Early on, Microsoft understood that the platform battle is won by those that win the hearts and minds of developers. DOS was a *terrible* environment, but developers built some cool applicaitons and the platform became a huge success. You have to look at this announcement in conjunciton with the Unix Services for Windows announcement.

    VB and the VB tools captured a good chunk of corporate developers. I hate VB, but you coul design and build simple forms based applications that talk to a database pretty quickly and easily. Visual Studio provide an excellent intregrated IDE (no flames from Borland lovers) for many C++ developers. it simplified a lot of routine stuff, made finding funcitons easy, integrated the debugger and more. Lots of folks.

    IBM recognized that it needs developers for Java to succeed and the purchase of Rational was aimed at getting the corporate developer that is on VB and VC++.

    With this compiler and the USFW annoucement, you can now take the *nix stuff and port it pretty easily and for free to Windows. No more need to assemble tools, install Cygwin or the like. There used to be a barrier to getting *nix stuff to Windows. it is now gone. Microsoft will now have a platform, that is free, to allow free software developers to make their stuff available on Windows as native applications. And you cna then add Windows extensions if you want.

    The unreliguous among us will grab this and move *nix stuff we've been missing or haven't had access to.

  18. Optimizing beyond Win32... by aksansai · · Score: 5, Interesting

    Microsoft has spent over a decade essentially supporting only ONE processor architecture, x86. The GNU project has to worry about applying optimization to a plethora of architectures, including the quirks associated with each particular implementation.

    Not Microsoft - it gets to focus on how to produce the most amount of work out of a processor of at least 80486 grade instructions. How easy is that? They get to throw a hundred developers to extract every bit of performance possible out of one processor. Every now and then make a modification to support a new supplemental instruction set (MMX, 3dnow!, SSE, etc.)

    If you read their optimization whitepapers, you will notice that much of their optimization is done at the math level - nothing Win32 specific. Also, their memory optimization, loop unrolling, inlining, etc. is considered top notch by many software developers.

    --
    Ayup
  19. Motive by ickoonite · · Score: 4, Interesting

    The objective of this is not too hard to discern - keep the geeks and individual developers on the Windows platform. It runs in the same vein as their licensing and releasing Services for UNIX - essentially an admission that CMD.EXE is not everyone's cup of tea as a command interpreter and that, to be frank, for proper scripting, it's actually pretty shit.

    I'm not quite sure where they'll go next. They may be following Apple's lead, who have, with Mac OS X, managed to capture an extremely sizeable proportion of the more moneyed developer market by taking advantage of the UNIX foundation and integrating it nicely. It may be that the next thing we'll see is a freebie X11 client.

    These kind of things start to make Windows an interesting platform - a closed and, possibly, insecure and buggy base but with some interesting and certainly useful FOSS bolt-ons to make it an extremely compatible platform - imagine having both the traditional Win32 and FOSS software libraries available with little to no portage required! It's a perfect situation for Microsoft - keep the users on Windows (DRMed up and whatever), but appease those who are tempted to switch to Linux by building the best bits right into their current platform.

    It's interesting, if nothing else...

    iqu :)

  20. Re:Loop variable? by man_of_mr_e · · Score: 4, Insightful

    It was never "wrong" per se.

    The for scoping you refer to was introduced in the C++ standard, which VC++ supported as far back as version 5 IIRC, however it supported it in a way that was not very useful. You had to turn off all MS extensions to use it, and that also had the side effect of breaking many other things.

    As of VC++7 they have a specific switch to enable/disable the for scoping (current version is 7.1, with 8.0 due out next year).

  21. Re:no! by firew0lfz · · Score: 4, Informative

    karma whoring, but anyway, here is the EULA:

    END-USER LICENSE AGREEMENT FOR MICROSOFT SOFTWARE

    MICROSOFT VISUAL C++ TOOLKIT 2003

    IMPORTANT-READ CAREFULLY: This End-User License Agreement ("EULA") is a legal agreement between you (either an individual or a single entity) and Microsoft Corporation ("Microsoft") for the Microsoft software that accompanies this EULA, which includes computer software and may include associated media, printed materials including best practices, white papers, templates, "online" or electronic documentation, and Internet-based services ("Software"). An amendment or addendum to this EULA may accompany the Software. YOU AGREE TO BE BOUND BY THE TERMS OF THIS EULA BY INSTALLING, COPYING, OR OTHERWISE USING THE SOFTWARE. IF YOU DO NOT AGREE, DO NOT INSTALL, COPY, OR USE THE SOFTWARE.

    MICROSOFT Software LICENSE
    1. GRANTS OF LICENSE. Microsoft grants you the rights described in this EULA provided that you comply with all terms and conditions of this EULA.
    1.1 General License Grant. Microsoft grants to you as an individual, a personal, nonexclusive license to make and use copies of the Software (i) for your internal use; (ii) for designing, developing, testing and demonstrating your software product(s); and (iii) for evaluation of the Software.
    1.2 Documentation. You may make and use an unlimited number of copies of any documentation, provided that such copies shall be used only for personal internal purposes and are not to be republished or distributed (either in hard copy or electronic form) beyond your premises except as otherwise specifically provided herein.
    2. ADDITIONAL LICENSE RIGHTS -- REDISTRIBUTABLES. In addition to the rights granted in Section 1, certain portions of the Software, as described in this Section 2, are provided to you with additional license rights. These additional license rights are conditioned upon your compliance with the distribution requirements and license restrictions described in Section 3.
    2.1 Sample Code. Microsoft grants you the right to use and modify the source code version of those portions of the Software identified as "Samples" in REDIST.TXT or elsewhere in the Software ("Sample Code") for the sole purposes of designing, developing, and testing your software product(s), and to reproduce and distribute the Sample Code along with any modifications thereof, in object and/or source code form. For applicable redistribution requirements for Sample Code, see Section 3.1 below.
    2.2 Redistributable Code-General. Microsoft grants you a nonexclusive, royalty-free right to reproduce and distribute the object code form of any portion of the Software listed in REDIST.TXT ("Redistributable Code"). For general redistribution requirements for Redistributable Code, see Section 3.1, below.

    3. LICENSE RESTRICTIONS -- DISTRIBUTION REQUIREMENTS. If you choose to exercise your rights under Section 2, any redistribution by you is subject to your compliance with the following terms.
    3.1 If you are authorized and choose to redistribute Sample Code or Redistributable Code (collectively, the "Redistributables") as described in Section 2, you agree: (i) except as otherwise noted in Section 2.1 (Sample Code) to distribute the Redistributables only in object code form and in conjunction with and as a part of a software application product developed by you that adds significant and primary functionality to the Redistributables ("Licensee Software"); (ii) that the Redistributables only operate in conjunction with Microsoft Windows platforms; (iii) to distribute the Licensee Software containing the Redistributables pursuant to an end user license agreement (which may be "break-the-seal", "click-wrap" or signed), with terms no less protective than those contained in this EULA; (iv) not to use Microsoft's name, logo, or trademarks to market the Licensee Software; (v) to display your own valid copyright notice which shall be sufficient to protect Microsoft's copyright in the Software; (vi) not to remov

    --
    Try not to let life get in the way of living.
  22. Ok, here's one by CrystalFalcon · · Score: 4, Informative
    Functions in named classes inside template classes, that are not written inline.

    Example: You create a storage class (my example was a self-redistributing binary tree). The template class Storage<T> has a subclass Storage<T>::Element that holds three Element pointers (parent, left child, right child) and one const <T> pointer.

    Of course, the Element class has a constructor, a destructor, a copy constructor, and an assignment operator defined. (Copy constructor and assignment op may not be formally required, but my experience says it's a very good idea to define them in anything that holds pointers).

    As in:
    // === DECLARATION ===

    template <T>
    class SimpleBinaryTree
    {
    public:
    SimpleBinaryTree();
    ~SimpleBinaryTree();
    void Add (const& T);
    // etc

    protected:
    class Element
    {
    public:
    Element();
    Element (const Element& source);
    ~Element();
    const Element& operator= (const Element& source);
    private:
    void Destroy();
    const Element& CopyFrom (const Element& source);

    }
    }

    // === IMPLEMENTATION ===

    template <T>
    void
    SimpleBinaryTree<T>::Element::Destroy()
    {
    // Clean up, common code for destructor and copy ops
    }

    template <T>
    const Element&
    SimpleBinaryTree<T>::Element::CopyFro m (const Element& source)
    {
    // Copy from 'source' - common code for
    // copy ctor and assignment op
    }
    This code will produce an error. VC++ does not handle functions in named classes inside templates that are not declared inline.

    (I may have missed some syntactic detail - It's been a long time since I wrote C++; I write C# these days. But the above annoyed me to no end. It works fine with gcc, which on the other hand can't handle when the functions are implemented inline, which should also work) :-(

    Side note: I absolutely love Microsoft's dev tools. This particular example is the exception to me, not the rule.
    1. Re:Ok, here's one by Yokaze · · Score: 4, Informative
      Some minor modifications like
      s/template<T>/template <typename T>/
      and for the external declarations
      s/ Element/ typename SimpleBinaryTree<T>::Element/
      and VS .Net 2003 says:
      ------ Build started: Project: test, Configuration: Debug Win32 ------

      Compiling...
      stdafx.cpp
      Compiling...
      test.cpp
      Linking...

      Build log was saved at "file://z:\devel\test\Debug\BuildLog.htm"
      test - 0 error(s), 0 warning(s)
      You probably tested it with .Net 2000. That version also had problems with partial template specialisations.
      --
      "Between strong and weak, between rich and poor [...], it is freedom which oppresses and the law which sets free"
  23. Re:They're just defending their turf. by Bastian · · Score: 4, Insightful

    A fair number of folks get into FOSS because they can't afford the dev tools. Intel releases a free C++ compiler that runs on Windows, but it also runs on Linux so there's a potential switching-over point there. Making their compiler free is a halfhearted attempt to stop this potential customer leak. It's the same reason why the copy protection on their dev tools is historically weak - in the long run they're better off having Visual Studio get pirated by _everyone_ if it keeps them from losing geeks and developers to competitors.

    At college, I knew one student in the CS department who owned a legal copy of Visual Studio, and it had been purchased for him by a contract employer. All the other Windows kids pirated it; the only folks who used Dev-C++ and the like were primarily Linux and MacOS people.

  24. Compatability does not seem so much of a problem by spitzak · · Score: 4, Informative

    I have quite successfully linked C++ libraries compiled with GCC, VC++, and the IntelCC compiler with no problems. It appears to be ok. Perhaps code that relies on internals of STL would fail, but at least pointers to STL objects actually port back and forth.

    I agree that VC++ produces faster code than GCC. Don't really know how much, because we don't use GCC on Windows anymore because of this, except to make dependencies for the makefiles. Can't be too much today, as our GCC-compiled Linux versions seem to run at the same speed as the IntelCC compiled Windows version.

    The IntelCC compiler produces code almost twice as fast as VC++6. I believe VC++7 is much better, however, but have not tested it.

  25. Yes please! Don't increase the cost for the rest! by jotaeleemeese · · Score: 5, Funny

    Fscking CDs are bloody expensive. Look at AOL, the IT magazines, heck, even newspapers that sell for a few cents. All of them are bleeeeding money given those CDs away for free.

    MS, with his zillions of money in the bank, can't affor to spend a few thousend making development tools available.

    No! Those communist ideas should be brought down and burned like the trojan horse they surely are.

    To give something for free! MS! Never!

    --
    IANAL but write like a drunk one.
  26. Re:Nice move by Anonymous+Brave+Guy · · Score: 4, Funny
    As a university student I can get VS.NET2003 Pro with the optimizing compiler for free anyway

    You know that copying it over Kazaa from your mate down the corridor is illegal, right? ;-)

    --
    If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
  27. Re:No lib.exe by ajp · · Score: 5, Informative

    Try using the link /lib switch. It offers the exact same functionality as lib.exe.

  28. Thanks, but I don't need it -- I have Linux by Anonymous Coward · · Score: 4, Insightful

    > MS seems to be doing a lot of this lately.

    Yes. And have you noticed that most of the free giveaways seem to be targetted at developers, rather than users?

    I suspect that Microsoft is trying to attract back the many developers who have switched to Linux.

    Developers like me.

    Unfortunately for Microsoft, it won't work, because it's not about the money.

    I didn't switch to Linux in order to get a free-as-in-beer platform.

    I switched to Linux to get a free-as-in-freedom platform.

    I got tired of Microsoft sabotaging my fvorite applications (e.g. AmiPro).

    I got tired of Microsoft changing the rules, in order to force me to buy upgrades, or to make me lock myself in to Microsoft's new schemes (.Net and MS Internet protocols this time).

    So I left Windows, and started developing for Linux. I don't even bother to port the finished product to Windows.

    There are over 10 million Linux desktop users, and multiple tens of millions of Linux server users. That's a big enough market for me.

  29. Re:From the posted EULA by shiftless · · Score: 5, Informative

    1.1 General License Grant. Microsoft grants to you as an individual, a personal, nonexclusive license to make and use copies of the Software (i) for your internal use; (ii) for designing, developing, testing and demonstrating your software product(s); and (iii) for evaluation of the Software.

    As in, for demonstration only. If you're going to distribute binaries, don't compile them with this tool.


    Nope. That clause governs copying of the Software- in other words, the compiler. It says nothing about distribution of works you create using the Software.

  30. Aha! So _that's_ where... by leonbrooks · · Score: 4, Funny

    ...Ken Thompson's version of the C compiler went! (-:

    --
    Got time? Spend some of it coding or testing
  31. Intel has a smilar deal by Animats · · Score: 4, Informative

    Intel's C++ compiler is also free for non-commercial use. It even runs under Linux.

    1. Re:Intel has a smilar deal by the_greywolf · · Score: 4, Informative

      last i checked, Intel's non-commercial license is explicitly linux-only. the only download for the Windows compilers are 30-day evaluations only.

      that is, after 30 days, every executable in the Intel directory becomes useless after 30 days.

      --
      grey wolf
      LET FORTRAN DIE!
  32. Does that mean: NO GPL-style Licenses??? by koi88 · · Score: 4, Interesting
    From the EULA I found here:
    ***

    3.2 If you use the Redistributables, then in addition to your compliance with the applicable distribution requirements described for the Redistributables, the following also applies. Your license rights to the Redistributables are conditioned upon your not (a) creating derivative works of the Redistributables in any manner that would cause the Redistributables in whole or in part to become subject to any of the terms of an Excluded License; and (b) distributing the Redistributables (or derivative works thereof) in any manner that would cause the Redistributables to become subject to any of the terms of an Excluded License. An "Excluded License" is any license which requires as a condition of use, modification and/or distribution of software subject to the Excluded License, that such software or other software combined and/or distributed with such software (x) be disclosed or distributed in source code form; (y) be licensed for the purpose of making derivative works; or (z) be redistributable at no charge.

    ****
    Does "Excluded License" mean GPL? A type of license that requires you to include the source code?
    If this is correct, you can't use it to compile most OS programs...
    You're also aware that you may not use the complier to produce anything for non-windows platforms... but that yould be difficult anymway.
    --

    I don't need a signature.
    1. Re:Does that mean: NO GPL-style Licenses??? by IO+ERROR · · Score: 4, Insightful
      I ran into this with VS.net 7.1. Upon discussion with the legal types, we determined this:

      In order to release our application under the GPL, we would have to write a "special exception" permitting linking with Microsoft runtime libraries, same as we currently do with linking against OpenSSL and some other BSD-licensed stuff.

      Not too difficult, but it does tend to become annoying to write all those special execptions. I proposed a minor change to the GPL's wording to address this type of situation, but who knows if it'll make it into GPL 3.

      Though there would be no problem compiling existing apps with this toolkit, as long as you didn't distribute the resulting binaries.

      This post is not legal advice. Check with your attorney first before doing anything. The issues raised here are quite complex legal issues and you are going to need a damn good lawyer, especially since you're dealing with Microsoft here.

      --
      How am I supposed to fit a pithy, relevant quote into 120 characters?
  33. Re:No assembler? by billcopc · · Score: 5, Interesting

    I remember a certain 12 year old student who couldn't afford MASM and didn't like TASM so he wrote his own macro preprocessor in C. Then the code was fed back to Debug.com and BEHOLD it worked.

    Young programmers today don't realize how spoilt they are. Back in the day we all had our copy of the Intel386 assembler document, and a heavily modified version of Abrash's Zen Timer. Have you ever seem a man shuffle assembler instructions by hand to alleviate register contention, or deliberately NOT'ing AX and reversing the following branch to lull the Pentium into correctly predicting the jump, wasting one cycle but saving 4-7 (depending on whether the code following the branch accessed RAM or not, since the prefetch would have been invalidated).

    For that matter, do you even remember when we used fancy tricks to either cope with the 64kb code segment limit, or trounce all over it. I hate to say it, but I miss those days, because back then it took more than an optimizing compiler and a few www tutorials for someone to be called a programmer. You actually had to know at least a little bit what was going on under the hood. It wasn't about compilers and libraries and distributed object frameworks, it was about making a limited machine do limitless things.

    --
    -Billco, Fnarg.com
  34. Get your free Microsoft Debugger right here by kylef · · Score: 4, Informative
    Anyone know where to get a free visual debugger for Win32?

    Ask and ye shall receive:
    Microsoft Debugging Tools for Windows

    That toolkit is part of the (also free) Platform SDK, but you can install it separately. It includes NTSD (command-line debugger) and WinDBG (GUI debugger), and KD (the kernel debugger). NTSD and WinDBG sit on top of the same user-mode debugging engine, "dbgeng.dll". They both include really fantastic on-line help which can teach you a lot about debugging in Windows. That said, they are not for the faint-of-heart (the Visual Studio debugger is much more user-friendly). KD.exe uses the kernel-mode debugger built into every NT kernel by default. Of course, you need a second machine to use KD and a serial cable; when broken into the NT kernel debugger, the debuggee is not in control.

    (Incidentally, is there a kernel-mode debugger available for Linux? Last time I checked, Linus opposed the concept very strongly, and Linux did not have one available. He called it a "crutch." Sorry, Linus. Kernel-mode device driver writers *like* their debuggers. I have to say that this could be one of several factors impeding device driver development on Linux.)

  35. Code theft? by moosesocks · · Score: 4, Funny

    It looks like some GNU developer has already disassembled it and integrated some of the code into GCC.

    I just went to compile vi, and an ASCII paper clip popped up onto my terminal:
    "It looks like you're trying to compile EMACS. Would you like me to launch the EMACS wizard now. Because you are stupid, I will launch it anyway"

    --
    -- If you try to fail and succeed, which have you done? - Uli's moose
  36. Re:Edit with VC6, use Scons to build.. by baxissimo · · Score: 4, Informative
    There could be switches whose meanings have changed slightly, but I just ran the two versions of "cl.exe /?" and compared the output of the two. Here's the list of differences:

    OPTIONS THAT WERE IN VC6 BUT AREN'T IN VC7 cl.exe:
    /GD optimize for Windows DLL
    /noBool disable "bool" keyword
    NEW VC7 cl.exe OPTIONS:
    /AI<dir> add to assembly search path
    /FU<file> forced using assembly/module
    /Fx merge injected code to file
    /G7 optimize for Pentium 4 or Athlon
    /GH enable _pexit function call
    /GL[-] enable link-time code generation
    /GS enable security checks
    /GT generate fiber-safe TLS accesses
    /QIfist[-] use FIST instead of ftol()
    /RTC1 Enable fast checks (/RTCsu)
    /RTCc Convert to smaller type checks
    /RTCs Stack Frame runtime checking
    /RTCu Uninitialized local usage checks
    /WL enable one line diagnostics
    /Wall enable all warnings
    /Wp64 enable 64 bit porting warnings
    /Y- disable all PCH options
    /Yl[sym] inject .PCH ref for debug lib
    /Zc:arg1[,arg2] C++ language conformance, where arguments can be: forScope - enforce Standard C++ for scoping rules wchar_t - wchar_t is the native type, not a typedef
    /arch:<SSE|SSE2> minimum CPU architecture requirements, one of: SSE - enable use of instructions available with SSE enabled CPUs SSE2 - enable use of instructions available with SSE2 enabled CPUs
    /clr[:noAssembly] compile for the common language runtime noAssembly - do not produce an assembly
    /showIncludes show include file names
    /w<l><n> set warning level 1-4 for n
    /wd<n> disable warning n
    /we<n> treat warning n as an error
    /wo<n> issue warning n once
    @<file> options response file
    So as you see most of the differences are new switches for the VC.7 version of cl.exe. Those shouldn't cause any trouble, as VC6 just won't use them by default. The two options removed I don't think are very interesting to most poeple. Besides, the VC.7 cl.exe is happy to ignore them:
    C:\Program Files\MSVC++2003>cl /nobool
    Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3052 for 80x86
    Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.

    cl : Command line warning D4002 : ignoring unknown option '/nobool'
    cl : Command line error D2003 : missing source filename
    So as another poster has said, it looks like it should just work if you put the new directories first in the MSVC6 bin/lib/include paths.

    Cool! All the updates I care about for VC 6 without having to switch to a new IDE!
  37. Re:Using new compiler with Visual Studio 6? by omicronish · · Score: 4, Informative

    I wonder if it is possible to use the newer commandline compiler from within Visual Studio 6. From what I hear, the .NET IDE isn't so great for C/C++ work. And come on, a project file is now called a "solution" file?? That's just dumb.

    I'm currently writing C++ code using Visual Studio.NET, and I haven't noticed any problems compared to Visual C++ 6. Some of the keyboard shortcut defaults are different, but you can revert to the VC++ 6 layout easily.

    I think the main reason it might not seem as good for C++ work is that VS.NET adds considerably more features geared towards .NET development, while C++ appears to be neglected somewhat. Remember that VS.NET's IDE supports all their .NET languages, and C++.

    For clarification, a solution can contain multiple projects. The old term they used was workspace. Yeah, I thought it was weird at first, but it's just terminology, plus a workspace sort of implies open windows and developer-specific settings to me. A single solution can be used by multiple developers (CVS works nicely).

  38. EULA section 3 by the_greywolf · · Score: 4, Interesting

    i'm personally having a bit of trouble understanding section 3 of the EULA.

    section 3.1 requires that software made with this compiler be distributed under (and i quote) "pursuant to an end user license agreement (which may be "break-the-seal", "click-wrap" or signed), with terms no less protective than those contained in this EULA" (emphasis mine)

    section 3.2 is less clear. part (b) requires that the "Redistributables" (which, by that, I assume means the standard library and the API libraries) must not be distributed "in any manner that would cause the Redistributables to become subject to any of the terms of an Excluded License." it then defines "Excluded License" with a description that sounds suspiciously like the GPL and related licenses. (i.e., no Open Source licensing.)

    section 3.1(ii) is an odd requirement: "(ii) that the Redistributables only operate in conjunction with Microsoft Windows platforms;" it sounds to me that it is explicitly excluding ReactOS and Winelib. (please correct me. i want to be wrong here.)

    under those restrictions, doesn't this unduly limit us as programmers? shouldn't we be the ones who decide how our software is distributed? Microsoft is requiring us to guard our code as closely as they guard theirs. isn't this a bit extreme?

    again, someone please correct me where i'm wrong. i want to be wrong.

    --
    grey wolf
    LET FORTRAN DIE!