Stories
Slash Boxes
Comments

News for nerds, stuff that matters

Slashdot Log In

Log In

Create Account  |  Retrieve Password

Free Optimizing C++ Compiler from Microsoft

Posted by michael on Sun Apr 18, 2004 08:26 AM
from the look-it-in-the-teeth dept.
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. ;-)"
+ -
story
This discussion has been archived. No new comments can be posted.
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More
Loading... please wait.
  • by naden (206984) on Sunday April 18 2004, @08:30AM (#8896581)
    I just tried the following program:

    #include

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

    And I got the output "Hello Suckers" .. anyone have any idea why ?
  • by Amiga Lover (708890) on Sunday April 18 2004, @08:30AM (#8896583)
    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.

    • by Anonymous Coward on Sunday April 18 2004, @08:50AM (#8896682)
      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.)
        • 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!
              • Re:No assembler? (Score:5, Interesting)

                by billcopc (196330) <vrillco@yahoo.com> on Sunday April 18 2004, @12:31PM (#8897894) Homepage
                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.
    • by Bastian (66383) on Sunday April 18 2004, @09:53AM (#8897010)
      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.
    • by jellomizer (103300) * on Sunday April 18 2004, @10:01AM (#8897048)
      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.
      • by SoSueMe (263478) on Sunday April 18 2004, @09:00AM (#8896729) Homepage
        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.
      • by Moridineas (213502) on Sunday April 18 2004, @11:46AM (#8897651) Journal

        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).

  • Yes! (Score:5, Funny)

    by Flingles (698457) on Sunday April 18 2004, @08:31AM (#8896589) Journal
    "tried to make Visual C++ more conformant to the ISO C++ standard"

    Score one for the team! Microsoft conformed to something!
    • Re:Yes! (Score:5, Funny)

      by nukey56 (455639) on Sunday April 18 2004, @08:47AM (#8896668)
      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!"
  • platform SDK (Score:5, Informative)

    by halfdan the black (638018) on Sunday April 18 2004, @08:34AM (#8896598)
    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.
      • Re:platform SDK (Score:5, Informative)

        by hobuddy (253368) on Sunday April 18 2004, @09:49AM (#8896990)

        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.

  • by foidulus (743482) on Sunday April 18 2004, @08:39AM (#8896623)
    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."
  • EULA? (Score:5, Interesting)

    by nukey56 (455639) on Sunday April 18 2004, @08:41AM (#8896634)
    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.
  • Suits me just fine.. (Score:5, Interesting)

    by multipart/mixed (163409) * on Sunday April 18 2004, @08:54AM (#8896700)
    ...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.
  • by pcause (209643) on Sunday April 18 2004, @09:23AM (#8896848)
    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.
  • Motive (Score:5, Interesting)

    by ickoonite (639305) on Sunday April 18 2004, @09:27AM (#8896875) Homepage
    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 [microsoft.com] - 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 :)
  • by Animats (122034) on Sunday April 18 2004, @11:56AM (#8897707) Homepage
    Intel's C++ compiler is also free for non-commercial use. [intel.com] It even runs under Linux.
    • by the_greywolf (311406) * on Sunday April 18 2004, @04:14PM (#8899329) Homepage

      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.

  • Code theft? (Score:5, Funny)

    by moosesocks (264553) on Sunday April 18 2004, @12:50PM (#8898004) Homepage
    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"
  • EULA section 3 (Score:5, Interesting)

    by the_greywolf (311406) * on Sunday April 18 2004, @04:02PM (#8899272) Homepage

    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.

    • by sweet cunny muffin (771671) on Sunday April 18 2004, @08:35AM (#8896605)
      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?
          • Ok, here's one (Score:5, Informative)

            by CrystalFalcon (233559) on Sunday April 18 2004, @09:47AM (#8896981) Homepage
            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.
            • Re:Ok, here's one (Score:5, Informative)

              by Yokaze (70883) on Sunday April 18 2004, @11:46AM (#8897654)
              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.
    • by startup.cmd (765643) on Sunday April 18 2004, @08:45AM (#8896659)
      Anyone know where to get a free visual debugger for Win32?

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

    • by kylef (196302) on Sunday April 18 2004, @12:41PM (#8897961)
      Anyone know where to get a free visual debugger for Win32?

      Ask and ye shall receive:
      Microsoft Debugging Tools for Windows [microsoft.com]

      That toolkit is part of the (also free) Platform SDK [microsoft.com], 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.)

      • by Waffle Iron (339739) on Sunday April 18 2004, @08:59AM (#8896724)
        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.

    • Re:Not needed (Score:5, Informative)

      by Anonymous Coward on Sunday April 18 2004, @08:37AM (#8896610)
      There's a decent free IDE available called Dev-C++ [bloodshed.net] for windows, it comes with mingw32 ofcourse.
    • Re:Not needed (Score:5, Informative)

      by lpontiac (173839) on Sunday April 18 2004, @08:41AM (#8896633)
      • 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++.
      • by enosys (705759) on Sunday April 18 2004, @08:54AM (#8896699) Homepage
        I was going to ask about "why get this if there's MinGW [mingw.org]" 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.
        • by man_of_mr_e (217855) on Sunday April 18 2004, @09:18AM (#8896822)
          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 [willus.com]

          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.
          • by Too Much Noise (755847) on Sunday April 18 2004, @11:48AM (#8897668) Journal
            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.
        • by Anonymous Brave Guy (457657) on Sunday April 18 2004, @09:54AM (#8897013)
          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.)
      • by spitzak (4019) on Sunday April 18 2004, @10:12AM (#8897092) Homepage
        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.
    • Re:Not needed (Score:5, Insightful)

      by tesmako (602075) on Sunday April 18 2004, @08:48AM (#8896677) Homepage
      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.
    • by aksansai (56788) <aksansai AT gmail DOT com> on Sunday April 18 2004, @09:08AM (#8896767)
      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.
    • by mattgreen (701203) on Sunday April 18 2004, @09:14AM (#8896803)
      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.
    • by aksansai (56788) <aksansai AT gmail DOT com> on Sunday April 18 2004, @09:24AM (#8896857)
      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.
    • Re:Loop variable? (Score:5, Insightful)

      by man_of_mr_e (217855) on Sunday April 18 2004, @09:38AM (#8896929)
      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).
    • by Anonymous Brave Guy (457657) on Sunday April 18 2004, @11:11AM (#8897394)
      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? ;-)

    • by shiftless (410350) on Sunday April 18 2004, @11:33AM (#8897573) Homepage
      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.
    • by omicronish (750174) on Sunday April 18 2004, @02:01PM (#8898560)

      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).

      • by baxissimo (135512) on Sunday April 18 2004, @01:57PM (#8898526)
        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 [slashdot.org], 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!
    • 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.