Slashdot Log In
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.
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. ;-)"
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
Loading... please wait.
Weird Output (Score:5, Funny)
#include
main()
{
printf ("Hello World!\n");
}
And I got the output "Hello Suckers"
Re:Weird Output (Score:5, Funny)
I tried it as well, the bug exists indeed. The \n really was missing from the output.
Parent
Aha! So _that's_ where... (Score:5, Funny)
Parent
MS seems to be doing a lot of this lately... (Score:5, Interesting)
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.
Re:MS seems to be doing a lot of this lately... (Score:5, Informative)
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...)
Parent
Yes please! Don't increase the cost for the rest! (Score:5, Funny)
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!
Parent
Re:No assembler? (Score:5, Interesting)
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.
Parent
Re:They're just defending their turf. (Score:5, Insightful)
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.
Parent
Re:MS seems to be doing a lot of this lately... (Score:5, Insightful)
Parent
Re:MS seems to be doing a lot of this lately... (Score:5, Funny)
Parent
Re:MS seems to be doing a lot of this lately... (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
Parent
Re:MS seems to be doing a lot of this lately... (Score:5, Informative)
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.
Parent
Re:MS seems to be doing a lot of this lately... (Score:5, 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. .net in my house. it activates all my tin foil hat's little buzzers and lights.
I'm a MCSE, but I would never purposfully allow
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).
Parent
Yes! (Score:5, Funny)
Score one for the team! Microsoft conformed to something!
Re:Yes! (Score:5, Funny)
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!"
Parent
platform SDK (Score:5, Informative)
Re:platform SDK (Score:5, 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.
Parent
Clippy's response to compiling OSS (Score:5, Funny)
EULA? (Score:5, Interesting)
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:
Use at your own discretion.
Suits me just fine.. (Score:5, Interesting)
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)
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.
The battle is for the hearts/minds of develop (Score:5, Insightful)
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)
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
Intel has a smilar deal (Score:5, Informative)
Re:Intel has a smilar deal (Score:5, 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.
Parent
Code theft? (Score:5, Funny)
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)
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.
Re:My experience with VC++ (Score:5, Insightful)
Parent
Ok, here's one (Score:5, Informative)
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: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.
Parent
Re:Ok, here's one (Score:5, Informative)
Parent
Re:My experience with VC++ (Score:5, Informative)
MS provides the Debugging Tools for Windows [microsoft.com] as a free download. GUI and command line debuggers are included.
Parent
Get your free Microsoft Debugger right here (Score:5, Informative)
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.)
Parent
Re:goes both ways... (Score:5, Funny)
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.
Parent
Re:Not needed (Score:5, Informative)
Parent
Re:Not needed (Score:5, Informative)
Parent
How about some evidence? (Score:5, Insightful)
Parent
Re:How about some evidence? (Score:5, Informative)
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.
Parent
Re:How about some evidence? (Score:5, Informative)
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.
Parent
Re:How about some evidence? (Score:5, Informative)
There are at least two easy answers to that question:
Parent
Compatability does not seem so much of a problem (Score:5, Informative)
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.
Parent
Re:Not needed (Score:5, Insightful)
Parent
It makes as much sense as Linux... (Score:5, Insightful)
If you bothered to download the
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.
Parent
Re:crack is free first time (Score:5, Informative)
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.
Parent
Optimizing beyond Win32... (Score:5, Interesting)
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.
Parent
Re:Loop variable? (Score:5, Insightful)
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).
Parent
Re:Nice move (Score:5, Funny)
You know that copying it over Kazaa from your mate down the corridor is illegal, right? ;-)
Parent
Re:No lib.exe (Score:5, Informative)
Parent
Re:From the posted EULA (Score:5, Informative)
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.
Parent
Re:Using new compiler with Visual Studio 6? (Score:5, 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).
Parent
Re:Edit with VC6, use Scons to build.. (Score:5, Informative)
OPTIONS THAT WERE IN VC6 BUT AREN'T IN VC7 cl.exe:NEW VC7 cl.exe OPTIONS: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: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!
Parent
Re:Does that mean: NO GPL-style Licenses??? (Score:5, Insightful)
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.
Parent