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

42 of 953 comments (clear)

  1. in other words by Anonymous Coward · · Score: 1, Insightful

    microsoft are giving away a C++ compiler, like gcc, for free.

    Seems like a pretty good thing to me.

  2. 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?

  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. Re:Weird Output by naden · · Score: 1, Insightful

    So you're a retard who can't code C or HTML.

    No. More so I'm a retard who keeps pressing Submit instead of Preview. There's a difference.

    --
    Funtage Factor: Purple
  5. 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 Joe+Tie. · · Score: 2, Insightful

      What really baffled me was the line This is a nice boon for those that have to deal with cross-platform compatibility

      I can think of some reasons to use microsoft's compiler, but it seems to me that cross-platform compatibility is the single largest reason not to. It can be hard enough keeping things cross-platform when you're using gcc on each, adding a whole other compiler to the mix is just asking for trouble.

      --
      Everything will be taken away from you.
    2. Re:How about some evidence? by man_of_mr_e · · Score: 2, Insightful

      Floating point performance is not the only performance out there, and in fact it's a benchmark i'm least concerned with.

      I care about optimization of the executing code and integer performance 99.999% of the time, and MS's compiler generates some extremely good code. Remember, the smaller it is, the better chance there is that it will fit within the cache, especially for tight loops.

      I've not been very impressed with the size or performance of gcc's integer code.

  6. Re:Weird Output by Borg453b · · Score: 2, Insightful

    Never mind the troll. I thought your "suckers" joke was funny, and so did my bro when I told him about it

    --

    - Mad, ingenous - they've both left you puzzled -
  7. Re:Yes! by naden · · Score: 2, Insightful

    Heh, sounds like this has confirmed to another standard. The standard way to fsck your competitors:

    "Embrace and extend"

    --
    Funtage Factor: Purple
  8. Last I tried, this failed to compiled by Carl+T · · Score: 2, Insightful
    for(int i = 0; i < 10; i++) ;
    for(int i = 0; i < 10; i++) ;

    This was a few years ago, with the then-latest version of Visual C++. I haven't used it since, but I've heard rumors that this particular scoping bug was eventually fixed. (What happed when you tried to compile this code back then is that it whined about there already being a variable called i.)

    It would be interesting to hear how well Microsoft's compiler works with templates. GCC still has some way to go, but it's getting better with each version, and it's starting to get hard to come up with valid code that doesn't compile. I can't imagine that MS put a lot of effort into their C++ compiler it they want everyone to migrate to their own language (C#, that is), but then again I'm not an MS fanboy, so what do I know?

    --

    This signature is not in the public domain.
  9. 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
  10. Re:can't believe I am doing this, but... by Anonymous Coward · · Score: 1, Insightful
    I don't quite like the way C does a few things things (like multi-dimensional arrays, and pass by reference)

    There is no pass by reference in C.

  11. Re:Port to Linux by Anonymous Coward · · Score: 3, Insightful

    wine CL myfile.c -o myprog.exe
    wine myprog.exe
    Is that what you want? It's not a crosscompiler. It compiles for Windows, not for Linux.

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

  13. Re:slightly OT, but chance to ask a question by bhima · · Score: 2, Insightful
    GCC is not as fast as some commercially available specialty compliers on those target platforms but that's not really the point of GCC. If someone requires the fastest complier on a specific platform then they go buy one. But really the difference is not that pronounced

    However I am not aware of a complier which compiles as many languages on as many different platforms. This IS the point of GCC. So I can use at work for a couple of different Motorola Micro-controllers, SH4 and general X86 (for fast prototyping). And I can use it at home for PPC, MIPS R5000 and AMD64. Think about that for a second! That's 16, 32 & 64 bit CPUs of both endian-nesses (sp?). I guess if I was selling GCC I would blather on about FORTRAN, ADA, and Java but I don't use these languages I use C and sometimes Objective C (Although I wouldn't say no to Embedded C++). That what makes GCC so wonderful.

    I will say that I have used Borland's free command line tools and for the X86 platform I have no complaints.

    Having said all of that I'd love to see some college student with too much time on his hands make a general comparison of GCC, Borland, and this MS offering. Just to satisfy our curiosity. However I think such a comparison would be incomplete without including the time and misery required to actually have the complier on your system. I think installing cygwin is comparable to the irritation of going through Borland's website at filling things out to get to the download!

    --
    Nothing in the world is more dangerous than sincere ignorance and conscientious stupidity.
  14. 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!
  15. 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).

  16. Re:Yes, but... by TheRaven64 · · Score: 2, Insightful

    If your code really is 100% portable, then it won't use any gcc-specific extensions, and so should compile fine with this compiler. If the MS compiler produces better optimisations (and I'd be very surprised if it didn't. Optimisation in gcc is handicapped somewhat by the need to be cross-platform) then there's no reason at all not to use it when compiling your apps for release in a Windows environment.

    --
    I am TheRaven on Soylent News
  17. Re:My experience with VC++ by Anonymous Coward · · Score: 1, Insightful
    I occassionally teach C++ programming now and we use the Borland compiler (actually, I start them out with the GCC C++ command line, then they go to GUI based Borland IDE).

    Bravo to you. Today's students are alarmingly phobic of the command line. The more familiarity with CLI programming, the better.

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

  19. 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.
  20. Re:.NET is the potential for platform independence by ajp · · Score: 2, Insightful

    Microsoft has already release a .NET framework for MacOS X and FreeBSD: rotor. And yet, for some inexplicable reason, people still use C++. Maybe they're waiting for the Linux kernel to be compiled on Mono in ECMA-standard C#?

  21. Re:Weird Output by Gabrill · · Score: 3, Insightful

    You guys are evil, and I like it. It's perfect justice to hit M$ with a Slashdot trying to download a tool that represents one the greatest advantages of open source and Linux (at least a little): the native compiler.

    --
    Always going forward, 'cause we can't find reverse.
  22. Re:MS seems to be doing a lot of this lately... by .com+b4+.storm · · Score: 2, Insightful

    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.

    Way to be sensationalist and not even entirely read the post you're replying to! Quoth the grandparent:

    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.

    Oh and - what is the big deal about including the CD? It's not like CDs are expensive, especially when they are mass-produced for inclusion with Macs and copies of OS X. How does this in any way "increase the cost for everyone?"

    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.

    Uh, what the hell are you talking about? What language? How about Objective-C, C, C++, and Java? Ya know, the main languages for developing OS X and UNIX programs?

    Yes there are "so many to choose from" (REALbasic, CodeWarrior and... uh... and.....) but it's a CD that's thrown in as a gift, and it's the same tools you can download later if they become out of date. And if you don't like Xcode, you don't have to use it. You are free to go out and pay for other IDEs and development tools if you wish.

    Again, what is the friggin deal? Apple includes, for free, a bunch of very powerful development tools so that you can, for free, develop programs for their OS. Yeah, what a bunch of evil bastards they are.

    --
    "Wow, you're like some kind of superhero able to ward off happiness and success at every turn."
    -- Ryan Stiles
  23. 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.

  24. Re:Using new compiler with Visual Studio 6? by baxissimo · · Score: 2, Insightful

    A solution is a workspace?? Wow. That's even worse naming. A workspace is basically just a collection of projects (which in turn correspond usually to an exe or a lib). So who says that a collection of exes and libs is going to be "solution" to anything? A workspace is a "space" for doing "work" on several projects at once (related or not). So workspace always seemed like a perfectly reasonable name to me. "Solution" somehow sounds like the same smug marketing speak that brought us "My Computer" and "My Music". Like they're stepping in my shoes trying to put words in my mouth. Maybe I want to have 5 completely unrelated projects in my "solution" because those are the projects I'm currently working on. How is that a "solution" to anyting? Anyway "solution" is a really pompous name for what amounts basically to a simple ASCII list of project file names. It's like the manager claiming that he "solved" the problem, when all he really did was just ask someone else to do it for him. Or like Al Gore "inventing" the internet.

    Bah! Solution files. Ridiculous.

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

  26. Re:Using new compiler with Visual Studio 6? by JFMulder · · Score: 2, Insightful

    By experience, I found that while the Intel compiler generates faster code, there are quite a few thigns that are broken in it where it sometimes crashes, compiles code that shouldn't be compilable, while MSVC gives an error as expected. Or literally generates bad code. Try debugging that! For speed, always compile with Intel. But for standards compliance, I've come to the conclusion that compiling with MS's 2003 compiler is a good thing just to make sure the code you write is compliant with the standards.

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

  28. Re:Yes please! Don't increase the cost for the res by Zork+the+Almighty · · Score: 3, Insightful

    I suppose landfills full of cds are "free" as well.

    --

    In Soviet America the banks rob you!
  29. Re:Optimizing beyond Win32... by moosesocks · · Score: 2, Insightful

    NOT TRUE

    This is simply not true. In the past decade, Microsoft has released versions of windows which run on PowerPC, MIPS, Alpha, and Itanium (not to mention Opteron). The first hardware NT actually ran on was MIPS - it was originally intended for the intel i860 which never made it to mass-production. (Source

    --
    -- If you try to fail and succeed, which have you done? - Uli's moose
  30. Re:MS seems to be doing a lot of this lately... by rnd() · · Score: 3, Insightful

    Why don't you try to install the latest GCC on a 1.0 linux kernel...

    --

    Amazing magic tricks

  31. Wait a minute... by ModernGeek · · Score: 0, Insightful

    It isn't April 1st anymore. We all know Microsoft wouldn't give dog shit for free, much less a compiler.

    --
    Sig: I stole this sig.
  32. Re:Compatability does not seem so much of a proble by Cuthalion · · Score: 3, Insightful

    but at least pointers to STL objects actually port back and forth

    This is inherently unsafe, and still relies on using the same implementation of the STL AND the compiler producing the same internal data structures.

    STL objects [generally] do not use virtual functions, as they are not meant to be derived from. As a result when you call pVector->reserve() that compiler calls its own reserve() no matter where the pVector came from.

    I'm not sure how this plays out in static linking, but if you're dynamically linking stuff this has even more dangers - each DLL may have it's own heap, and you can't allocate something on one heap and free it on another. This is one major advantage of COM's reference counting - the object frees itself to the proper heap.

    --
    Trees can't go dancing
    So do them a big favor
    Pretend dancing stinks!
  33. Sorry, but... by bonch · · Score: 2, Insightful

    If you're still using something less than Windows 2000, you should spend the $100 (not $207 that you lie about) to upgrade to at least 2000. It's been four years now--you don't still use a Linux kernel from four years ago, do you?

    Sometimes I wonder why there are so many stupid "BSOD" jokes (I haven't seen a BSOD in five years), then I see that a lot of people here still haven't gotten off the 9x line like most everyone else has. Which explains it.

    The .NET Framework SDK is free.

  34. Re:Loop variable? by harlows_monkeys · · Score: 3, Insightful
    I haven't used MS VC++ for a few years (fortunately), but does it still get the scope of loop variables wrong?

    This is the most annoying thing about using compilers that came out before the final C++ standard. The proper scope of such variables flip-flopped between draft standards. Here's a trick I saw somewhere that fixes this problem.

    At the top of your code, put this:

    #define for if(false);else for

    That will make the for loop variable scope correct, no matter which draft of the standard the compiler follows.

  35. Uh...what a ridiculous post by bonch · · Score: 3, Insightful

    Only on Slashdot does Microsoft giving away a free command-line compiler (which they've always done in the past along with the rest of the SDK) somehow mean "MS is worried they're losing their development community."

    Losing it to what? Windows is 95+ of the market out there. As pointed out before, this isn't some "aggressive effort to get people to start developing .NET apps"--.NET has been a free download since the very beginning.

    Come on, guys, let's stay rational here.

  36. Re:They're just defending their turf. by mingot · · Score: 2, Insightful

    People also tend to perputually generate the stuff. So if someone was in the position to spend 400 bucks on a computer, although that money is now gone, chances are that they will eventually have another 400 bucks.

    Really, though it all comes down to priorities.

    Reminds of a time when I walked into a Bally shoe store. Extremely overpriced footware that makes VS.NET enterprise edition seem like a bargin, in some cases. After browsing for a few minutes a salesman walked over and asked if I was interested in anything. I chuckled and made an offhand remark about the products being nice but not being able to afford anything. He chuckled back and said "You can afford as many pairs of these shoes as you want." I gave him a puzzled look and he replied "But only if you want them."

    It took me a second for what he said to sink in, but by god, he was right. If I wanted those shoes I'd have a pair. Maybe not that day, but a week or a month down the road, I'd have them. Just like I have the pretty PDA phone I can't afford, the car I can't afford, the laptop I can't afford, the shed full of badass power tools I can't afford, and everything else that I have that cost a LOT more than shoes.

    PS. Before you make a 'yanks love credit cards' or a 'you must have your mom wrapped around your finger' comment consider the fact that I a) have not gotten a dime from my parents since I turned 18 and b) have ZERO debt, save my house, which I simply could not attain (in a reasonable timeframe) without using credit.

  37. Re:No assembler? by Malc · · Score: 2, Insightful

    Thank goodness we don't have to do that anymore. Talk about poor productivity levels.

  38. Re:No assembler? by ThrobbingGristle · · Score: 3, Insightful

    Do you remember when you had to go out and kill your own food if you wanted to eat?

    Do you remember when you had to crank-start your car?

    Lowering the barriers to programming has been good by and large... would we have all this free software if it all required assembly programming?

  39. 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?
  40. Re:No assembler? by Cruxus · · Score: 2, Insightful

    Is it just me, or is it preferable to think about what you can do by writing a program rather than how you can get it done under technical constraints? If programming were all about making sure this or that about some register was good or some small amount of memory was not used up, I'd probably have no interest in it at all, and I would have gone back to playing video games or something.

    I'll take my high-level object-oriented programming languages, like C++ and Java, running on modern systems any day!

    --
    On vit, on code et puis on meurt.