Re: Compiling from source
It's partially the open source mentality (distribute source, not binaries) and partially due to the fact that they would prefer not to have to go through the trouble of maintaining binaries. Not everyone uses Windows and Visual Studio. There are dozens of common operating systems and compilers, each combination of which may require a binary compiled specifically for it. That's a huge and unnecessary burden on them.
Quote:
Also, typically, there are different source files for Windows and Linux. I understand that some functions may use the operating system API, but for a lot of projects, only the standard C++ library is used. Hence, can't the same source files be used for both operating systems?
No, there are lots of things that the C++ Standard Library can't do. Lots. Even then, say you are using an fstream. That's part of the library, but Windows and Linux have different file structures, so your code is going to be different anyway.
Re: Compiling from source
Yeah, it's a heck of a lot easier to push a source folder onto sourceforge than to provide binaries for Windows gcc, Windown VC++, Redhat, Debian, Solaris, MacOSX...
Besides, lots of libraries have compiler or environment specific code in them to make them run smoother for you. Also, most of the time, you want to be able to debug the library if something goes wrong and a production binary will not include debugging symbols.
Re: Compiling from source
Quote:
Originally Posted by
karnavor
...Surely the executable at the end will be the same as on another compiler, because the code is the same?
I don't know if that is true (doubt it), but it obviously isn't "surely".