Advice on starting C programming
Displaying 1-8 of 8 total.
1
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
basil

I figure there's plenty of people lurking around here who know what they're talking about with regard to C. I want to start playing with it, and I'm after some advice on starting. Specifically, everybody points me to djgpp as an excellent free compiler, but I've tried a couple of times now and can't get my head around the operation. My programming experience thus far has been v1/2/3 and a bit of matlab and AVR assembly. All of those involve typing the code, pressing a button or typing a short command line ('vcc all') and I'm good to go. My escapades in C seem to involve compile comands that take me 5 minutes to type and don't make sense.
So in short, I'm asking whether there's an easier way to do this or whether I just need to stop being a dick and try harder. Any advice/thoughts would be appreciated.

Posted on 2005-01-12 04:51:27

Ness

usually compiling with djgpp is something along the lines of 'gxx hello.cpp', unless your compiling multiple files or giving the linker other flags.

post the command line you have and mabey I can help

Posted on 2005-01-12 09:28:14 (last edited on 2005-01-12 09:28:37)

Rysen

I don't have much experience with DJGPP, but if you're a textpad user what might be easier for you is to set up the compiler as a Tool so that when you want to compile all you have to do is press CTRL+1 or something.

Here's a link that'll show you how to do it.

Posted on 2005-01-12 11:05:00 (last edited on 2005-01-12 11:06:04)

Omni

Okay, I can help! I'm trying to learn C too, and I decided to use the GNU Compiler Collection/GCC because it's completely free. And neat.



Here's what I did.

1. I read up on some C tutorials. (http://www.cprogramming.com, http://http://cppreference.com/)
2. I downloaded Dev-C++, which is like a GCC, with IDE, for Windows. Really good, and not DOS based. And it comes with its own C tutorials! (http://www.bloodshed.net/devcpp.html)
3. I read up on some more C.
4. I realized that Dev-C++ is just a wrapper around the GNU Compiler Collection, so I began to learn to use those individual tools.
5. I read about GCC. (http://gcc.gnu.org/, http://gcc.gnu.org/onlinedocs/))
6. I read about Make, which can help create and package my code by using GCC and other tools. (http://www.gnu.org/software/make/manual/make.html)
7. I realized I needed some Windows-compatible GCC tools, but I didn't want to download Cygwin (which is almost a complete Unix tool emulation layer). Instead, I downloaded MinGW, which is a collection of individual GNU utilities ported to Windows. (http://www.mingw.org/)
8. I started writing some files, and began programming for the Sega Saturn!


...okay, your final result might be different, but that's good. I didn't at first realize how to get started. After I read up on how using the GCC collection and tools, then I realized how they all work togther. ...I need to actually program some more.



While you're at it, of course http://www.gamedev.net is probably pretty handy, and Cprogramming.com has some example links to good OpenGL and SDL demonstrations.

Does this sound like a good place to start?

Posted on 2005-01-12 12:36:48 (last edited on 2005-01-12 12:40:50)

basil

Cheers Omni - bloodshed is exactly what I'm looking for. cprogramming.net, which in retrospect I should have been able to find myself, is also extremely handy. Ta muchly.

Posted on 2005-01-12 15:02:58

Omni

The GCC documentation in particular I found interesting because it finally told me what linking and stuff like that was about. I would have no clue how you go from compiled code to executables if I hadn't read some of that stuff.

Well, not to mention it was also incredibly long, but anyway. You're very welcome. In retrospect, I think Bloodshed's Dev-C++ actually uses the MinGW distribution of tools for its GCC functionality.

Posted on 2005-01-12 16:06:44 (last edited on 2005-01-12 16:08:19)

Toen

Why don't you just get an IDE instead of messing with that command line rubbish

Posted on 2005-01-19 01:09:00

Omni

Because Dev-C++ is an IDE, that just happens to be built around some awesome command line tools. It doesn't take an exponentially larger amount of effort to learn command line manipulation of those tools, and you'll be able to see and do a lot more cool stuff than otherwise.

Posted on 2005-01-19 16:56:08


Displaying 1-8 of 8 total.
1
 
Newest messages

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.