Dark Bit Factory & Gravity

PROGRAMMING => C / C++ /C# => Topic started by: va!n on July 27, 2007

Title: Which C/CPP compiler?
Post by: va!n on July 27, 2007
Afaik the VC2005 compiler is one of the best compiler available, generating very fast code (even it needs some more bytes)... There is the Intel Compiler too but its seems to optimize only for Intel CPUs...

Now i would like to hear your opinion about following problem. Whats the best free available C/CPP compiler, you can add in a comercial project without the need of any licence stuff/problem :P And where is the difference between those compilers? Thanks in advance.

Title: Re: Which C/CPP compiler?
Post by: Jim on July 28, 2007
I've done some work on OpenWatcom. www.openwatcom.org (http://www.openwatcom.org)  The source for the compilers and tools is under an OpenSource license, and you can distribute exes and libraries under any license you like.

There's also devc++, http://www.bloodshed.net/devcpp.html (http://www.bloodshed.net/devcpp.html). Which is based on gcc.

There're other plenty of others...what do you mean by "add in a commercial project"?   Do you mean distribute the compiler as part of a commercial product,eg. a development kit?

Jim
Title: Re: Which C/CPP compiler?
Post by: va!n on July 28, 2007
There're other plenty of others...what do you mean by "add in a commercial project"?   Do you mean distribute the compiler as part of a commercial product,eg. a development kit?

Yes, for example ;)
Its very important that the generated code will be very good and fast and that there are no licence probs.noit



[Edit]
From the website: "February 21th 2005 : Dev-C++ 5 Beta 9.2 (4.9.9.2) released !" << Seems developing stopped? That would not be nice. Some time ago i heard that the integrated compiler of VC2005 may is free - just only the VC2005 package itself is not free!? I am a bit confused about this... I would like to use the VC compiler if its really free but i dont know if there may be any license problems when adding it to a development kit. mhhh
Title: Re: Which C/CPP compiler?
Post by: Jim on July 28, 2007
I've used several commercial dev kits that have gcc as the back end.  The issue then is what you have to do to satisfy GPL.  This includes
1) making the compiler part of the package free - you can only charge for the other bits and/or support.
2) making any changes you make to gcc source available to anyone else.
3) providing a link to and/or distributable version of the source if you changed it.
<edit>
4) include a copy of the GPL with your distro

If you used OpenWatcom, you'd have to consult their license, it's OpenSource approved, but not GPL.

I doubt VC2005 Express compilers come under any kind of license that lets you redistribute them.

Also look at DJGPP http://www.delorie.com/djgpp/ (http://www.delorie.com/djgpp/) which might be more up-to-date than devc.
<edit>It might, but djgpp is for 32bit DOS.  Maybe look at mingw instead, www.mingw.org (http://www.mingw.org)

Jim
Title: Re: Which C/CPP compiler?
Post by: va!n on July 28, 2007
@Jim:
Thanks for your fast reply and the great infos. I will collect all infos i can get atm and will compare things like "license politic, how good optimized is the output and so on". Btw, are there any up to date benchmarks between available compiler/linkers packs?
Title: Re: Which C/CPP compiler?
Post by: Jim on July 28, 2007
All the compilers I've mentioned produce good code.  Only Intel and Microsoft compilers will generate code that uses SSE though, so they might be faster in some applications.  Library support and STL is another matter.  C99 and C++03 standards compliance is another.
For some facts, try http://cmeerw.org/prog/freecpp/ (http://cmeerw.org/prog/freecpp/).  Benchmarks of code depend far too much on what you're trying to achieve.

Jim
Title: Re: Which C/CPP compiler?
Post by: va!n on July 28, 2007
ah, very interested overview. thanks!  :goodpost: