The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM


High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Carreer:Networking Programming in Unix (C programming Language) vibhory2j UNIX for Dummies Questions & Answers 5 09-05-2008 04:57 PM
Unix Systems Programming Vs Unix Programming BCarlson Shell Programming and Scripting 0 05-24-2006 11:34 AM
programming for unix environment carlvernon Shell Programming and Scripting 1 04-21-2006 08:05 AM
c programming or unix programming!? moxxx68 High Level Programming 1 03-30-2004 05:53 AM
Java Programming in UNIX Environment cub Post Here to Contact Site Administrators and Moderators 1 06-25-2002 05:12 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-18-2006
Banned
 

Join Date: May 2006
Posts: 25
Stumble this Post!
New to C Programming in UNIX environment

Hi all,

I know the basics of C programming, but I dont know a single thing about how to write, compile and run C code in UNIX, also where liberaris are stored, how .headers files are being managed in unix, how to debug c code and what are the available GNU tools for c programming in linux env, and what are the advantages of c programming in unix env.

Can any body give me the start. Thnx in advance.

Cheers,
Patras
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 07-18-2006
blowtorch's Avatar
Supporter
 
Join Date: Dec 2004
Location: Singapore
Posts: 2,325
Stumble this Post!
Lets see, you can write code in unix with any of the myriad of text editors available - try to familiarise yourself with either the vi or the emacs editors. For compiling code, you can use the GCC (have to install it seperately - though it will usually be available on Linux by default). Many systems come with their native C compilers, like Sun Studio on Sun or HP's HP C compiler.

On almost all systems, the libraries are available under /usr/lib, while includes are under /usr/include. Both libraries and include files specific to a certain products may be installed elsewhere during product installation as well.

As for debugging, you can use GDB which is part of the GCC. For more info on GCC, go here.
Reply With Quote
  #3 (permalink)  
Old 07-19-2006
Banned
 

Join Date: May 2006
Posts: 25
Stumble this Post!
Thanks for your reply. So it means path for header and liberary files is setup in system kernel at the time of installation? Because I never configured any path and compiled my first program with cc today and it went thru.

I dont have gcc installed, is there any major difference btw cc and gcc? Or initially I can continue with cc only. Any documentation is available for cc? I tried to understand the man page but not satisfactory, any good debugger link also pls.

thanks in advance.

cheers,
Patras
Reply With Quote
  #4 (permalink)  
Old 07-19-2006
blowtorch's Avatar
Supporter
 
Join Date: Dec 2004
Location: Singapore
Posts: 2,325
Stumble this Post!
What OS are you working on? That may tell you what native C compiler you've used. Also, check the output for 'ls -l `which cc`'. (Note the backquotes around 'which'). You may find that cc is actually a link to gcc (quite common). As for the documentation, is it for learning C or learning how to use cc/gcc? For C and debugging links, check the Unix Tutorials/Programming Tutorials/Shell Scripting Tutorials page.

In fact, I think that should answer almost all your questions. And one more piece of advice... check the FAQs page. You will get tutorials, recommended pages, ready-made scripts and more.
Reply With Quote
  #5 (permalink)  
Old 07-19-2006
Banned
 

Join Date: May 2006
Posts: 25
Stumble this Post!
Thanks for your reply. I'm at SCO Unixware, here is the output of which command:
Code:
$ ls -l `/usr/ucb/which cc`
lrwxrwxrwx    1 root     sys              15 Apr 16  2002 /usr/bin/cc -> /usr/ccs/bin/cc
I think its cc only not a link to gcc, I'll go thru FAQ's also.

Thanks for all your help.

Cheers,
Patras
Reply With Quote
  #6 (permalink)  
Old 07-19-2006
Registered User
 

Join Date: Aug 2005
Location: Saskatchewan
Posts: 923
Stumble this Post!
Quote:
Originally Posted by patras
Thanks for your reply. So it means path for header and liberary files is setup in system kernel at the time of installation?
close, not in the kernel, but in gcc itself.
Quote:
Because I never configured any path and compiled my first program with cc today and it went thru.
Which is as it should be.[quote]I dont have gcc installed, is there any major difference btw cc and gcc?
Quote:
Or initially I can continue with cc only. Any documentation is available for cc? I tried to understand the man page but not satisfactory, any good debugger link also pls.
cc and gcc ought to understand some of the same options, but not all of them. The -o, -I, -l, and -L flags ought to work the same.
Reply With Quote
  #7 (permalink)  
Old 07-20-2006
Registered User
 

Join Date: Jul 2006
Posts: 10
Stumble this Post!
my CC link.

Quote:
Originally Posted by patras
Thanks for your reply. I'm at SCO Unixware, here is the output of which command:
Code:
$ ls -l `/usr/ucb/which cc`
lrwxrwxrwx    1 root     sys              15 Apr 16  2002 /usr/bin/cc -> /usr/ccs/bin/cc
I think its cc only not a link to gcc, I'll go thru FAQ's also.

Thanks for all your help.

Cheers,
Patras

On my solaris 9, its:
lrwxrwxrwx 1 root other 14 Feb 7 12:03 /opt/SUNWspro/bin/CC -> ../prod/bin/CC
Reply With Quote
Google The UNIX and Linux Forums
Reply

Tags
linux

Thread Tools
Display Modes




All times are GMT -7. The time now is 11:38 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0