| |||||||||||
| |||||||||||
Turning C from source to a running program
With scripting languages (or near-scripting languages) such as shell, Tcl, Perl, Python and PHP, the developer just edits a file of program code, and tests it - the tools that he uses roll the translation of his source into something that can be run without him having to make further inputs. C is somewhat different .... to here's how to convert a C program from source to executable.
1. Enter your source code (a file extension .c is common). 2. Compile into an object file (extension .o or .obj). This is a binary file that contains machine code for the machine that you'll be running on, but it's not yet a complete program - it's a program component. In effect, your compiling has turned a raw potato into a roasted one, but it's still not a complete meal. 3. Link / Load / Taskbuild your .o or .obj files; that joins them together into a single conglomorate executable file, and brings in standard library files too, so that the file as a whole can be run. You have now added your Roast Beef, Yorkshire Pudding, and brussel sprouts and made up a complete course. * The COMPILER will initally run the C pre-processor which will act on lines starting with a # character, allowing for other files to be included, constants defined, and selective debug code / system dependent code to be included as appropriate. * The whole process of one or more compiles followed by a link may be defined in a makefile. The Makefile defines the commands necessary for each step of the process, and also lets you define which file depends on whihch other file - the net effect of this is to enable the compiler to skip over files that haven't been changed since you last did a compile by looking at the timestamp on the .c file in relation to the timestamp on the .o; very clever - I remember back to "pre-make" days and running compiles and loads of a big CAD system I wrote that took nearly an hour to process! (written 2006-10-06 05:20:13) Associated topics are indexed under C201 - C and C based languages - C Language FundamentalsC202 - C and C based languages - A first practical program
Some other Articles
A pattern in changeWell House Manor Hotel, Melksham, Wiltshire Open Opening approaches! Turning C from source to a running program HTML tables - telling whats wrong from the display Signs of Leek Why do we still need C? Drive time Age discrimination law 1638 posts, page by page
Link to page ... 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33 at 50 posts per pageThis is a page archived from The Horse's Mouth at http://www.wellho.net/horse/ - the diary and writings of Graham Ellis. Every attempt was made to provide current information at the time the page was written, but things do move forward in our business - new software releases, price changes, new techniques. Please check back via our main site for current courses, prices, versions, etc - any mention of a price in "The Horse's Mouth" cannot be taken as an offer to supply at that price. Link to Ezine home page (for reading). Link to Blogging home page (to add comments). |
| ||||||||||
PH: 01144 1225 708225 • FAX: 01144 1225 707126 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho | |||||||||||