GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 02-Feb-2007, 05:02
aijazbaig1's Avatar
aijazbaig1 aijazbaig1 is offline
Member
 
Join Date: May 2006
Location: Sweden
Posts: 134
aijazbaig1 will become famous soon enough

Using C command line compilation


Hello pals.
Ive recently moved to linux(ubuntu 6.0) and im trying to get used to the world of command line compilation for C.
Since I was initially used to the IDE interface I never really had the experience of what happens internally.
Since I am now interested in doing the same things using command line I think there are certain things which I need to know.
Like I have installed the gcc compiler and now I wish to know how do i use it to compile files and then use the make utility (is it a utility or what?) to then create object files.
Who linkes the object files and how exactly do we end up with the executables?

I know i sound very naive and stupid now... ..bt pls forgive me for that as I will eventually become smart enough (hopefully) if guys like u would give me a lil pushstart

Anyway..hope to hear something soon,
__________________
Hope to hear from you guys!

--------------------------------------------------

Best Regards,
Aijaz Baig.
  #2  
Old 02-Feb-2007, 06:11
TurboPT's Avatar
TurboPT TurboPT is offline
Regular Member
 
Join Date: Feb 2006
Location: Atlanta, GA
Posts: 958
TurboPT is a jewel in the roughTurboPT is a jewel in the roughTurboPT is a jewel in the rough

Re: Using C command line compilation


See this google cached link, for the main link is now dead:
http://209.85.165.104/search?q=cache...lnk&cd=3&gl=us

it has basic command line use, plus a make file example.
__________________
Use the force...read the source!!
WYCIWYG -- what you code is what you get!
  #3  
Old 03-Feb-2007, 17:05
davis
 
Posts: n/a

Re: Using C command line compilation


Quote:
Originally Posted by aijazbaig1
Hello pals.
Ive recently moved to linux(ubuntu 6.0) and im trying to get used to the world of command line compilation for C.
Since I was initially used to the IDE interface I never really had the experience of what happens internally.
Since I am now interested in doing the same things using command line I think there are certain things which I need to know.
Like I have installed the gcc compiler and now I wish to know how do i use it to compile files and then use the make utility (is it a utility or what?) to then create object files.
Who linkes the object files and how exactly do we end up with the executables?

I know i sound very naive and stupid now... ..bt pls forgive me for that as I will eventually become smart enough (hopefully) if guys like u would give me a lil pushstart

Anyway..hope to hear something soon,

cpp is the C pre-processor
as is the assembler
ln is the linker
ar is the archiver
gcc is the GNU compiler collection with default of C language
objcopy/objdump describe the object file contents and change their content to differing file formats.

<tool-name> <--h> produces help
<tool-name> <--version> tells the version

:davis:
:davis:
  #4  
Old 04-Feb-2007, 02:18
aijazbaig1's Avatar
aijazbaig1 aijazbaig1 is offline
Member
 
Join Date: May 2006
Location: Sweden
Posts: 134
aijazbaig1 will become famous soon enough

Re: Using C command line compilation


Hello.
Thnx for the link guys. I would see how far can i go without being troubled again..
__________________
Hope to hear from you guys!

--------------------------------------------------

Best Regards,
Aijaz Baig.
  #5  
Old 05-Feb-2007, 17:59
msm1593 msm1593 is offline
Junior Member
 
Join Date: Jan 2007
Posts: 31
msm1593 is on a distinguished road

Re: Using C command line compilation


Also if you're just learning a new complier check out gdb, it has capabilities to set break points, set through commands, print variables at certain points, etc. It can be a life saver for larger programs, and especially programs using memory addresses- where the error probably won't show up until much later in the program if at all!
 
 

Recent GIDBlogMeeting the local Iraqis by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Alt. Problem: PHP 4.4 GD compilation errors Fezzen Computer Software Forum - Linux 2 12-Aug-2005 21:16
Unfamiliar with this compilation error code <compilation of class into object file> jkube1980 C++ Forum 1 24-Apr-2005 14:57
What is "Ambigious symbol" ??*( a compilation error) small_ticket C++ Forum 2 07-Jan-2005 21:10
Compiler that Shows Stages of Compilation? BobbyMurcerFan C Programming Language 2 26-Nov-2004 18:03
Structure compilation problem nkhambal C Programming Language 1 03-Aug-2004 08:16

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 16:00.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.