Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Extra Discussion (http://www.chiefdelphi.com/forums/forumdisplay.php?f=68)
-   -   Q&A Discuss: Quick C Programming Q (http://www.chiefdelphi.com/forums/showthread.php?t=22404)

CD47-Bot 23-10-2003 11:41

Q&A Discuss: Quick C Programming Q
 
Thread created automatically to discuss a question in the Q&A Forum.

Quick C Programming Q
Quote:

Ok, I'm making the switch from Pascal to C, and I dun no the name of the program I need to write C (like you use turbo pascal to write in pascal). If someone could give me the name of a program it would be much appreciated. Thnx

Jeremy_Mc 23-10-2003 11:43

Or you could not spend copious amounts of money on a compiler and get LCC, DevC++ by Bloodshed Software, and numerous others that are out there.

Borland's Compiler is free, but their IDE is not...

Just because it's Borland or Microsoft doesn't mean it's the best, but I must say that they are very nice (and expensive) IDE's...

Team852 (DB) 15-11-2003 15:55

Compilers
 
If you've had any experience on the terminal (command line), just use the GNU GCC (3.0?) compiler. If you have a UNIX system, it comes with this. The same for Macintosh (OS X). Otherwise, do a search and download it.

GCC is free, and I would say it's the most widely-used compiler out there right now.

Most UNIX professionals use GCC as part of any IDEs they use, as well as anyone programming on Mac OS X (Project Builder/XCode uses GCC as its compiler).


Note however, that it is not an 'integrated development environment'. It is only a compiler, so you have to learn how to write code in individual files, bring in libraries, and then compile it using either a 'make' file (unix convention), or typing everything in on the command line yourself.

You could also go out and find an integrated development environment. Most of these cost real money. I must say that the Microsoft IDEs are not organized in an intuitive way. I haven't seen any of the others at this point.


Note: You cannot use a third party IDE (or even GCC) to program for the Microchip PIC18. Those IDEs and compilers are configured to compile code for your computer, not the microchip.

They will help you to learn C and figure out how things work, but you will have to use the MPLAB IDE and C18 to write code for the microchip PIC.


I would recommend this book:

The C Programming Language, 2nd Edition, by Brian W. Kernighan and Dennis M. Ritchie.

It defines the ANSI Standard, all its conventions, and the standard UNIX libraries.

You can get a copy via Amazon.com here:

http://www.amazon.com/exec/obidos/tg...lance&n=507846

Jeremy_Mc 15-11-2003 17:45

I love GCC with a passion, but newbies might find it difficult to get the concept of compiling then linking the files...

When GCC compiles, if you have more than one file, it doesn't make them into an executable. You typically end up with a .o file which you have to use a linker to link into an executable...

I'd suggest if you're on Win32 just stick to DevC++ (which has an IDE + linker) or LCC (IDE + linker). If you want to use the console, stick to DGJPP (the DOS port of GCC which has an IDE + linker built right in :)).

Matt Krass 16-11-2003 01:16

This is slightly off-topic, but does anyone know if the compiler for the Robot Controller can be run on the command line without the IDE? I'd rather use my Eclipse IDE, configured to use that (if I can make it use minGW and SDL I think it'll use anything, man that was a pain! :D)

And Dev-C++ is good and comes with minGW, which is a windows ports of gcc IIRC.

Noah 16-11-2003 02:19

My assumption is that it saves the files you work with as plain text .c and .h files, and therefore can be opened, manipulated, and other such wonderful things before being reopened in the IDE and compiled. I doubt that they have a command line utility.

Mike Soukup 16-11-2003 11:16

Quote:

Originally posted by Matt Krass
This is slightly off-topic, but does anyone know if the compiler for the Robot Controller can be run on the command line without the IDE? I'd rather use my Eclipse IDE, configured to use that (if I can make it use minGW and SDL I think it'll use anything, man that was a pain! :D)
Yes, it's possible. Wildstang is using cygwin & make for our work with the EDU and will probably use it when writing code for the real robot. You can get the Makefile from the zip in Dave's post about using last year's EDU & OI: http://www.chiefdelphi.com/forums/sh...threadid=22652. It should have all the info you need for using the compiler with the command line.

Mike


All times are GMT -5. The time now is 15:22.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi