Getting Started in UNIX - incorporating C coding


 
Thread Tools Search this Thread
Operating Systems Solaris Getting Started in UNIX - incorporating C coding
# 1  
Old 01-08-2010
Getting Started in UNIX - incorporating C coding

I'm just starting a 'serious' coding in UNIX, so what I need is to run a C code on UNIX, What do I have to install (app) prior to coding/running the code and how do I compile that code?
can I write my c code in UNIX or I need to have a visual studio for this?

Last edited by joeyg; 01-08-2010 at 12:14 PM.. Reason: Made title more descriptive
# 2  
Old 01-08-2010
You need to install a C/C++ compiler and headers plus library objects for it. Which compiler and how to install it really depends on your system -- OSX? AIX? BSD? Solaris? IRIX? HPUX? SCO? If Linux, what distro of Linux?

Anyway... Once installed, most UNIX C compilers are used the same way, though they may have different extensions. They can compile .c source files into .o object files with:

Code:
cc file.c -o file.o

..and can link one or several object files into a single executable file with:

Code:
cc file.o a.o b.o c.o -o executable_file

...which will run as a normal program, just ./executable_name.
# 3  
Old 01-08-2010
actually I'm not quite familiar with UNIX systems ( OSX? AIX? BSD? Solaris? IRIX? HPUX? SCO), I'm using putty.
# 4  
Old 01-08-2010
Putty is not UNIX, the same way your monitor is not your computer. Putty's a terminal emulator you use to talk to UNIX on some other computer. And we really do need to know what your system is to help you; they provide similar environments, but are managed very differently.

Since you have a shell login, try 'uname -a' and see what that prints.
# 5  
Old 01-08-2010
here u go
Code:
SunOS omicron 5.8 Generic_117350-61 sun4u sparc SUNW,Sun-Fire-480R


Last edited by Yogesh Sawant; 01-27-2010 at 03:25 PM..
# 6  
Old 01-11-2010
any help with this?
# 7  
Old 01-25-2010
Sorry, I somehow didn't see this.

I don't know how much about SunOS, I'd suggest having this thread moved to the Sun section where you'll more likely encounter posters that do. I do think Sun has their own proprietary compilers, for one thing, though gcc should be available as well.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. What is on Your Mind?

Coding Style at UNIX.com forums

Hi, as I mentioned in this thread(https://www.unix.com/shell-programming-and-scripting/280737-awk-function-return-permutations-n-items-out-m.html), a helpful coding style may improve overall value and support for people who come here and want to learn things the participants from unix.com have... (2 Replies)
Discussion started by: stomp
2 Replies

2. Homework & Coursework Questions

UNIX script coding HW question

i am trying to write a script code in unix that will: 1. The problem statement, all variables and given/known data: display following menu to user: (A) Add (B) Subtract (C) Multiply (D) Divide (E) Modulus (F) Exponentiation (G) Exit Then ask user for choice (A-F). After taking... (5 Replies)
Discussion started by: renegade755
5 Replies

3. Shell Programming and Scripting

UNIX script coding help?

Unix script coding help? i am trying to write a code that will display following menu to user: (A) Add (B) Subtract (C) Multiply (D) Divide (E) Modulus (F) Exponentiation (G) Exit Then ask user for choice (A-F). After taking users choice ask user for two numbers and perform... (3 Replies)
Discussion started by: renegade755
3 Replies

4. Shell Programming and Scripting

How to get started with Unix

I'm new in UNIX learning. Can you please guide me. How to get start and then step by step things in Unix. (I know all basic commands) (5 Replies)
Discussion started by: Varsha katre
5 Replies

5. UNIX for Dummies Questions & Answers

Unix coding for triggering informatica

Hi, I have very little knowledge with unix and pmcmd. I need help with a issue. I have to see whether a file has been dropped in a particular location/path. If the file dropped I have to check the last modified time, which should be greater than 8pmEST the prior day. If the file has been... (4 Replies)
Discussion started by: redwolves
4 Replies

6. UNIX for Dummies Questions & Answers

Getting Started with Unix....

Hi all I'm a beginner in Unix world.I want to know from where i should start Book,E-Book.web site ,...etc by the way how many version does unix have? i should install which version? How to install it? and very important,is there any simulator for training purpose? for example can i install unix... (2 Replies)
Discussion started by: ZarrinPour
2 Replies

7. UNIX for Dummies Questions & Answers

Unix coding tip required

Hi! Suppose I am at a location xyz:/abc1/abc2/abc3 Is it possible to move to another location xyz:/mnl1/mnl2/mnl3 by some coding within a script? (5 Replies)
Discussion started by: udiptya
5 Replies

8. UNIX for Dummies Questions & Answers

Getting Started with Unix

I am new to Unix and want to learn it thoroughly. From where can I download books/e-books and tutorials for free of charge:confused: (2 Replies)
Discussion started by: indiansoil
2 Replies

9. UNIX for Dummies Questions & Answers

how do i get unix started

i am a total newbie...and want to learn unix....firstly...how do i get unix....if it is available on the internet then where is it?...and how do i get this to work then.....plz plz help asap...really desperate now thanx in advance (10 Replies)
Discussion started by: chaitanyamanot
10 Replies

10. UNIX for Dummies Questions & Answers

Unix Coding Standards

Hi, I am looking for some coding standards for Unix Shell Scripting. Can anyone help me out in this? Regards, Himanshu (3 Replies)
Discussion started by: himanshu_s
3 Replies
Login or Register to Ask a Question