Advice on which C to hang one's hat.

For everything that's not in any way related to PureBasic. General chat etc...
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Advice on which C to hang one's hat.

Post by Dare2 »

Hi,

I need to become more conversant with C and C++ in order to improve my conversions C -> PB

I have played with a number of C/C++ compilers and the first thing I learnt was that although the language is defined to be portable, the implementations are not. *dang*

So, other than Pelles C, what would be a good C/C++ compiler to settle on. Hopefully one that is:
  • 1: Quite common so has good code examples/open source/etc
    2: Has a reasonable IDE and associated developer tools
    3: Is Free (I don't want to develop with it, just use it to learn)
Is there a non-MS front end for visual C/C++ (command line compiler is free and on the system already, I believe) and is visual c the way to go?

Would GNU be the clue?

And a good tutorial site (pref one that deal with people aspiring to be dummies - I am not yet at the lofty dummy level)

Thanks.
@}--`--,-- A rose by any other name ..
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

hmm i dont know of a good tutorial site. i bought a 400 pages book about c++, so i could get better.

Hmm of c++ compilers, i like http://www.bloodshed.net/devcpp.html and it comes with a nice gui too.
But i think u should take devcpp 4 and not the beta(5).

Also if you are following a tutorial, they mostly use iostream to print and get input on console, wich is the best way to do it, as i think its a bit faster. But iostream lib is big, both in c++ and devcpp (about 130 kb for both compilers..), but using stdio, i got my hello world down to 3 kb.
User avatar
GedB
Addict
Addict
Posts: 1313
Joined: Fri May 16, 2003 3:47 pm
Location: England
Contact:

Post by GedB »

I'll second Dev-Cpp, it is a very good compiler.

Under the surface it uses GCC/Mingw compiler, for which huge amount of documentation exist:

http://gcc.gnu.org/onlinedocs/gcc-3.4.2/gcc/
http://www.mingw.org/

The big advantage over Pelle-C is that it is also a C++ compiler.

Another reason particular to myself is that I also use SmartEiffel, which can uses GCC as it's back end.

http://smarteiffel.loria.fr

This gives me three distinct languages with their own strengths and weaknesses all working together.
User avatar
tinman
PureBasic Expert
PureBasic Expert
Posts: 1102
Joined: Sat Apr 26, 2003 4:56 pm
Location: Level 5 of Robot Hell
Contact:

Post by tinman »

thefool wrote:But i think u should take devcpp 4 and not the beta(5).
I'd recommend the beta (5) version every time. There are not so many problems with it if you perform a clean install, and betas earlier than 4.9.9.0 had some annoying crashes. But it seems fairly stable now and I use it at work and at home (for PB libraries ;).

There's also LCC which PB used to use parts of. It was a decent set of tools, but I thought the IDE sucked. Haven't seen it for a few years though.

The Borland C++ command line compiler and C++ X IDE (300MB d/l) are both free for personal use. I don't know if the compiler is included with that IDE, but I guess you should be able to use it if not. There are also a few tutorials kicking around for being able to use Borland's compiler with a free generic IDE/editor, but I can't remember what it was called (Edit: list here).

There's also DJCPP, which I never bothered trying out , although it can give you are true DOS compiler rather than just a console mode application :)

I didn't think the MS compiler was freely available. It doesn't come with Windows anyway. The development kit doesn't include it either AFAIK.
If you paint your butt blue and glue the hole shut you just themed your ass but lost the functionality.
(WinXPhSP3 PB5.20b14)
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post by Dare2 »

Hi Guys,

Thank you for the responses and info.

Given that you all think Dev-Cpp, I'll go with that. It was one of the many I downloaded and one that I thought might be the shot, so I feel good about it.

I also looked at Watcom C, which appeared to be OK but is not supported by the development community as far as I can see - there must be a reason for this. (Actually, can't remember if it supported C++ now). Wasn't Watcom one of the biggies many centuries ago?

Anyhow, Thanks again! Really appreciated. :)

PS: A whole lot of C is self evident. But there are some constructs (esp ++ stuff) that are really peculiar. 8O
@}--`--,-- A rose by any other name ..
carolight
User
User
Posts: 41
Joined: Mon Feb 09, 2004 11:08 am
Location: Gold Coast, Australia

Post by carolight »

I like the LCC No Frills approach to C, especially with learning the API.

Haven't done any C since I found PB, but I think knowledge of C really helps.

For tutorials, I like the about.com ones, if you can stand the adverts - the Delphi ones are really good:

http://cplus.about.com/library/blctut.htm

There's a really big jump from C to using C for Windows, though. and this tutorial may help:

http://winprog.org/tutorial/

However, there's no substitute for the Petzold book.
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post by Dare2 »

Hi carolight,

Thank you for the links

And also for the reference to the Petzold book (I assume "Programming Windows" after a quick google.)

Now all I need is a way to increase my time-effectiveness tenfold and improve my comprehension by an order of magnitude or so. :)
@}--`--,-- A rose by any other name ..
User avatar
GedB
Addict
Addict
Posts: 1313
Joined: Fri May 16, 2003 3:47 pm
Location: England
Contact:

Post by GedB »

If you're looking for a good book check out C++ in Action

http://www.relisoft.com/book/

The author, Bartosz Milewski, is very big on writing small, dependancy free executables. He proves his point with a tiny version of battleships. Which weighs in at only 280k, including graphics and sound.
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post by Dare2 »

Heya GedB,

You're a mind reader .. ? (I was just thinking that everything seems to have dependancies.)

That appears to be a very comprehensive website. Thanks for the reference and the link.

PS: Considered looking at eiffle once or twice, and thought "nah, more to learn". What advantages does it give you that the others don't?
@}--`--,-- A rose by any other name ..
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

well i use devc++ and the exe's dont need any dependencies :P
the book gedb mentioned seems to be good (especially that it seems to describe windows programming.)

@tinman:
ok maybe i should go try the newest beta. i had a few problems with the last beta i tried, but my executables got bigger using the beta than using devcpp 4..? maybe i just did something wrong :P
where do you find C++ X IDE ?


btw i also wondered if there where any gui designer?
(that eventually maked an event loop too :) )
User avatar
GedB
Addict
Addict
Posts: 1313
Joined: Fri May 16, 2003 3:47 pm
Location: England
Contact:

Post by GedB »

Mingw allows GCC to be used without dependanices
http://www.mingw.org/

Some GCC based compilers use Cygwin, which does require a DLL.
http://www.cygwin.com/

The other main cause of of dependancies are the GUI library: MFC, Fox, etc. The C++ in Action book contains a chapter on wrapping the Win32 library yourself to avoid these dependencies.

Eiffel is a great language. It is OO how it should have been. You have all the benefits of a modern OO langague. Container classes, reusable libraries, automatic documentation. However, it compiles to a single executable.

If I could afford a commercial license for ISE eiffel that would be all I needed (it's the price of a small car!) SmartEiffel isn't quite there so I get by best with a set of different langauges.
User avatar
tinman
PureBasic Expert
PureBasic Expert
Posts: 1102
Joined: Sat Apr 26, 2003 4:56 pm
Location: Level 5 of Robot Hell
Contact:

Post by tinman »

thefool wrote:@tinman:
ok maybe i should go try the newest beta. i had a few problems with the last beta i tried, but my executables got bigger using the beta than using devcpp 4..? maybe i just did something wrong :P
where do you find C++ X IDE ?
Can't say I really noticed the executable size, I never used v4 much. I haven't used DevC++ for much C++ stuff yet either. But make sure you turn off the debugger and turn on optimisations otherwise it'll leave in all that stuff even if you don't need it :)

C++ Builder X can be downloaded here. You need to create an account on the Borland site, but that's all AFAIR. Don't get fooled with the "Builder" part of it's name (like I did :), it's got none of the GUI stuff in it that other Borland Builder products have - it's just an IDE.
thefool wrote:btw i also wondered if there where any gui designer?
(that eventually maked an event loop too :) )
Try the wxWindows stuff. I haven't used it but there seems to be a lot of support, including GUI designers - not sure about event loops though (guess you mean event handler type things, like VB?).

Edit: quick search on google and it does seem taht wxWindows apps are "event handler" based, although you can still do it manually if you prefer. Might need to get my finger out and try it some day :)
If you paint your butt blue and glue the hole shut you just themed your ass but lost the functionality.
(WinXPhSP3 PB5.20b14)
carolight
User
User
Posts: 41
Joined: Mon Feb 09, 2004 11:08 am
Location: Gold Coast, Australia

Post by carolight »

Yes, Programming Windows by Petzold - sorry - I thought everybody owned one, like the Bible.

Mine is Programming Windows 95, and I still use it for XP.
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post by Dare2 »

carolight wrote:Yes, Programming Windows by Petzold - sorry - I thought everybody owned one, like the Bible.
lol. :D

Thanks again. :)

Edit:

@theFool

I see what you mean about sizes:

Code: Select all

#include <stdio.h>
int main()
{
     printf("Hello World!\n");
}
= 13.9kb

Code: Select all

#include <iostream>
using namespace std;
int main()
{
     cout << "Hello World!\n";
}
= 144 Kb 8O
@}--`--,-- A rose by any other name ..
Max.²
Enthusiast
Enthusiast
Posts: 175
Joined: Wed Jul 28, 2004 8:38 am

Re: Advice on which C to hang one's hat.

Post by Max.² »

Dare2 wrote:So, other than Pelles C, what would be a good C/C++ compiler to settle on.
Beside the Pelles C Compiler and Bloodshed Dev-C++, I am also using the free Microsoft Visual C++ Toolkit. While no IDE, it has advantages when it comes to compiling supplied sources which include very special Macros not supported by the other compilers (beside some other pros)

http://msdn.microsoft.com/visualc/vctoolkit2003/
Post Reply