View Full Version : Good free C++ Compiler?

9th July 2003, 16:28
So.. is there any good free ANSI-C++ compiler or even development kit for windows which allows me to release the software made with it, without my software having to be free or open source?

I think I'll try learning that language (found a nice beginner's book, but sadly it doesn't cover the subject of needed software at all), but I don't want to learn to use a new software if I somehow get good enough to actually release something someday. And I'm poor, so I can't pay a lot for commercial software. I guess I could make do with textpad as editor (it has syntax highlighting, and I use it for HTML, so I know how to use it), but I'd still need a compiler. BTW, I don't even know what a debugger does :)


9th July 2003, 16:48
So, you've decided to embark on the path of the coder.

I'd use Dev-C++ if I were you.
Just beware that if your book is about Visual C++, then you'll need to have MS Visual Studio.
Otherwise, you'll be fine with Dev-C++ for WinAPI and console coding.

9th July 2003, 17:08
It's about standard ANSI-C++, so I should be fine :)

I'll check out your link tomorrow, when I'm awake ;)


9th July 2003, 17:47
gcc would be just fine. Using gcc does not mean that the output has to be open sourced.

9th July 2003, 18:08
I thought if I used something that's under the GPL, I'd have to OS it myself. Or is gcc under LGPL or some other license? Is it available for windows?


9th July 2003, 18:15

9th July 2003, 19:13
You only have to GPL something if you include code that is GPLed. The strictest interpretation goes only as far as saying that linking to a GPL library requires GPLing.

9th July 2003, 19:29
You could use gcc, but you can't use cygwin. So your software would only be
available on *nix OSes. Since using gcc without cygwin is impossible on windows.

Since the cygwin dll is GPL and is required by almost all applications compiled with gcc on windows. Anything you release that requires the dll will have to be released under the GPL licence or another OS licence (http://www.opensource.org/docs/definition_plain.html). If the dll was covered under LGPL, then it would have been alright, but that is not the case.


You could still use gcc for development, but in the future you would have to choose one of the following.

1. Keep all copies of your software "in house".
2. Port your application over to another C++ compiler. Then release it commercially.
3. Purchase a special cygwin licence from redhat. A lot of GPL stoftware is dual licenced for commercial use.
4. Release you software with the source and a copy of the GPL licence. You can still charge money for it, but anyone you sell it to can redistribute copies and base their own GPL software on the source. This is how the linux distros can charge money for boxed copies of the OS.

10th July 2003, 00:22
Az, for any help or suggestion don't hesitate to PM me!

10th July 2003, 03:00
Thanks guys, thanks Drizzt :)

Hmm.. I'm not üplanning to do anything on any other OS than windows in the near future, so I don't need portability. I won't make anything open source before I'm sure my coding doesn't suck a lot (so chances are I'll never open source anything ;)), but I sure would want to be able to release stuff once (if) I wrote something useful.

Some questions, as this book says absolutely NOTHING about software, and I only had a few school lessons in Borland TurboPascal... what is a debugger? I thought debugging was just the process of finding and exterminating bugs (i.e. testing your software, looking at your code for the 20th time...)

If I want to do stuff with/for standard windows GUI, I need Visual C++, or are there other libraries for that? (And yes, I will try and learn the language first before doing some fancy schmancy interfaces - but this is an area that's important to me, since so many coders can't seem to produce a proper standards compliant easy to use interface, and I believe that the interface is one of the most important parts of a program)

Thanks again so far :)

I've discovered that the CD of the book contains the full version of Borland C++ Builder Standard, but the book is from '99, and I don't yet know if I am allowed to release software made with C++ Builder Standard... should I just use this software?


10th July 2003, 03:26
here you can find some tips about debugging in c++



10th July 2003, 03:44
Thanks Rakido, but this is still a little over my top :)

I just started reading yesterday :)


10th July 2003, 04:20
no prob, them start with this site

http://www.zock.com/64er/8407/0018.html :D


10th July 2003, 05:07
If I want to do stuff with/for standard windows GUI, I need Visual C++,

Hmm.. I migrated from TurboPascal 7 to C myself so i got confused about a few terms myself (delay()..pause() etc) however you do not require Visual C++ to code windows interfaces (even though it might be easier).. just have fun coding :D

10th July 2003, 05:21
OK, I will :)

But in the beginning, C++ is really very similar to pascal.. but my skillz are VERY basic yet :)


10th July 2003, 06:48
Az, use C++ without O²P, it's the best solution for you. Pascal and C++ are totally different, unless you where referring to Delphi.

10th July 2003, 07:07
Sorry, but what is O²P? :)

I just meant that I shadily remember that variable declaration, functions etc. were similar in Pascal.. but I know that there's lots of stuff that's totally different in C++ :)


10th July 2003, 07:13
OOP (or O²P) is Object Oriented Programming.

10th July 2003, 07:36
But the book is about learning C++ as an OOP language, and as I understand it OOP can be very powerful.. why do you think I shouldn't use it? Too complicated? :)


10th July 2003, 07:51
OOP is really powerful when working in large teams, in large companies, when you have to:
- Share your code with everyone
- Grant the maximum portability
- Grant the maximum level of (manteinance + bility)
- Grant the maximum re-usability of you code.

OOP it's not simplier, gives slower exe and gives heavier exe.

(only reason for the need of OOP is that programmer are becoming dumber and dumber...)

10th July 2003, 08:42
I say go ahead and learn OOP, just because you've learnt it doesn't mean you'll have to use it.
Even if I think you should.

10th July 2003, 08:55

I think I'll try Borland's free C++ command Line compiler and TextPad first.


10th July 2003, 09:08
Learn C first. Stay away from OOP for now.

Better yet start with a scripting language to become familiar with programming. Because in the end all languages are similar. Try Perl or Python.

10th July 2003, 09:58
"You could use gcc, but you can't use cygwin. So your software would only be available on *nix OSes. Since using gcc without cygwin is impossible on windows."

Try MinGW.
Borland has a nice free C++ compiler available for Windows, albeit with no IDE. lcc-win32 has an IDE and is free but I don't think it does C++.

10th July 2003, 09:58
I suggest Perl too, it's a great place to get started.

10th July 2003, 10:27
runderwo: Dev-C++ uses MinGW.

10th July 2003, 10:31
I'm with thop, I'd recommend C first before learning C++ (altough C++ is great for those wonderful little command-line tools ;)).

Though neither language is easy, C is less complicated, so you can have learned a complete language in less time, whereas learning C++ first will require much more time, although learning C afterwards will require mostly "unlearning" much of what you learned in C++ ;).

And afterwards you could learn some OOP programming (OO/C++). Definitely get yourself a good C/C++ book you will need it.

Why not take the java route it's easier to learn and there's a really good free IDE available www.eclipse.org.

10th July 2003, 10:56
I have bought myself a (good, I presume :)) book about C++, that's why I started this thread :)

I don't think I want to learn any scripting language before now, I have had Pascal at school, so at least I know what a function is ;)

The book I have starts very basic, but introduces OOP quite early, so I'll learn OOP while learning C++.

I just installed the free Borland C++ Builder 5.5 command line compiler, will use TextPad (at least it has syntax highlighting and can call the compiler) for editing.

I just compiled my first .exe :)

#include <iostream>

using namespace std;

int main()
cout << "Hello MURC";


10th July 2003, 11:53
If you want to learn C++, don't learn C first.

The main reasons for this are

C++ has easier to use memory allocation and file I/O. If it turns out you need to use the C versions, its far easier to go back and learn them once you're familiar with the rest of the language.

There are things that are good practice in C, but bad habits in C++. It makes sense to learn the C++ way of doing things than learn the C way and then have to unlearn it again. #define springs to mind as the obvious example.

C++ doesn't mean you have to use OOP, you can just ignore that part and come back to it later :)

Using OOP isn't always slower at runtime anymore either, provided you use a decent modern compiler (ie not gcc, which is horrendous at OOP). In some cases its a little faster, in others a little slower.

If that first program comes from your book, I'd be slightly suspicious of it because of this line

using namespace std

Take a look here (http://www.rafb.net/efnet_cpp) for books and also free compilers if you decide you don't like the Borland one.

10th July 2003, 12:26
Here is a good read too, to get you started in the right direction.


(Do as I say, Not as I do.) ;)

10th July 2003, 14:42
Why be suspicious because of using namespace std? (BTW, the book also told me I could omit that line and write std::cout <<... but that is a little tiresome if I have to do it for every command ;))


10th July 2003, 15:04
The std namespace has lots of stuff in it and by using namespace std you're reasonably likely to get a namespace collision.

For example, the std namespace has something in it called 'count', which effectively means you cannot declare something else called count as the compiler would not know what you are refering to, std::count or just your count.

if you don't want to have to type std::cout the whole time you can do

using std::cout;

Which does the same thing but just for std::cout and not the whole namespace.

10th July 2003, 15:48
Thanks for the warning :)

I tend to use german names for my variables, functions, etc, because that makes distinction between my own and the language's names even easier, so I guess the risk for me will be low :)

BTW, the book is "GoTo C++ Programmierung" be André Willms, published by Addison-Wesley.


10th July 2003, 20:55
Just beware of those ü.
The compiler are a bit picky about non-english letters.

11th July 2003, 05:50
no high-ascii characters :) I'm used to that from HTML :)


12th July 2003, 10:53
Another alternative would be OpenWatcom.

This compiler doesn't follow 100% C++ standards, but it's sure something to look at.
Do you remember the games using DOS4GW under DOS? Well all games were coded using Watcom. :)