Compiling tools for unix machine using C


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Compiling tools for unix machine using C
# 1  
Old 04-24-2012
Compiling tools for unix machine using C

Hello everyone i have a script written in C and i need to compile it in a unix machine i am a first time programmer and i do not know how to compile this and also i need to save the results in a table please help we normally use instructions like build_bb -f but now im confused i dnt knw hw to use that.Smilie
# 2  
Old 04-24-2012
You should have a cc or gcc command. This is the C compiler.
This will tell you whether you have to use cc or gcc:
Code:
which gcc
which cc

One of them should show something like
Code:
/usr/bin/cc   (or /usr/bin/gcc if you have gcc)

If you don't check back here and let us know.

suppose you have a file mycode.c and you want to compile and run it.
You now know the namke (gcc or cc) to use, I'm using gcc you may have to use cc, okay?
Step 1:
Code:
gcc mycode.c -o mycode

This means compile mycode.c into an exectutable file called "mycode"

Next run your code:
Code:
./mycode

Note the ./ in front of the file name.

Have fun.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Compiling UNIX System V

I tried to install UNIX system v R4, but the sources i've found(archive.org and WinWorldPC) are incomplete (missing cc, for example). Since archive.org has the source files i thought i could compile it and upload it for other users, but i cant get it to work. Any advice? (10 Replies)
Discussion started by: Parodper
10 Replies

2. UNIX for Dummies Questions & Answers

Compiling error in UNIX

Hi, I'm trying to compile the code for a program and I run into the following error, ncfile.h: In constructor ‘ncfile::NcAttribute<T>::NcAttribute(const std::string&, const char*)': ncfile.h:357: error: there are no arguments to ‘strlen' that depend on a template parameter, so a declaration of... (1 Reply)
Discussion started by: bstephens
1 Replies

3. UNIX for Dummies Questions & Answers

UNIX tools on windows ?

is there any tool or something to install and practice unix on windows ? (8 Replies)
Discussion started by: ded325
8 Replies

4. Shell Programming and Scripting

How to transfer files from unix machine to local machine using shell script?

Hi All.. Am new to Unix!! Am creating a shell script in which a scenario is like i have transfer the output file from unix machine (Server) to local directory (Windows xp). And also i have to transfer the input file from the local directory to Unix machine (Server) Any help from you... (1 Reply)
Discussion started by: vidhyaS
1 Replies

5. Programming

Compiling Pro*C program under unix

Hello, I am trying to compile a Pro*C program under unix: proc iname=test.pc works fine but then I am not able to compile the test.c file : gcc test.c -o test.o -L $ORACLE_HOME/lib -l clntsh /usr/bin/ld: Object file format error in: /u01/app/oracle/product/10.1.0.2.0/lib:... (1 Reply)
Discussion started by: nsmrmd
1 Replies

6. Programming

compiling c program in unix

if somebody can help me pls. i need the source code for a shell which compiles C or java programs in unix i need a very short and simple one, just the compiling part Respect (2 Replies)
Discussion started by: zlatan005
2 Replies

7. UNIX for Advanced & Expert Users

UNIX monitoring tools

Guys, I would like to know who are using monitoring tools? I use Nagios before but it seems is more on Linux and Windows platform. - Nagios - BigBrother - BigSister - Cacti - MRTG - JFFNMS - anymore? Please give comment too I would like to have some comment on UNIX monitoring tools.... (2 Replies)
Discussion started by: dwarf007
2 Replies

8. Infrastructure Monitoring

UNIX Monitoring tools

I need some monitoring tools for SCO 7.1.4 Does anybody reccomend some software that I can install to monitor mem leaks and odd SAR values etc (2 Replies)
Discussion started by: trebor1
2 Replies

9. UNIX for Dummies Questions & Answers

Basic Unix tools

I like to know the bare minimum development/ testing tools which can be used with Unix environment wherein the applications are written in different combination - C++ COBOL.. I like to know list of development, performance, testing tools that can be used in Unix . Thanks in advance ls1429 (1 Reply)
Discussion started by: ls1429
1 Replies
Login or Register to Ask a Question