![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
| Problem in HP-UX compiling | vasanthan | HP-UX | 1 | 04-20-2008 08:34 AM |
| help on compiling a C program on Tiger | cleansing_flame | High Level Programming | 4 | 01-29-2008 03:59 PM |
| Problem compiling program | rochitsharma | High Level Programming | 28 | 07-23-2006 09:56 PM |
| Problem in PowerDNS compiling | secret4all | SUN Solaris | 0 | 10-13-2005 12:47 AM |
| Compiling problem | iandunn | SUN Solaris | 1 | 09-21-2005 08:41 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
To explain this better:
You write the program into a file called "cprog.c". Then after you execute "gcc cprog.c -o cprog", use the command "ls" to list the current files in the directory ("man ls" for more info). You should see a file called "cprog". This file cprog was created when you did the "gcc cprog.c -o cprog", and this command means that you use the program gcc (gnu c compiler) on the c source file "cprog.c". Then the "-o" means to output the binary file to "cprog". If you hadn't used "-o", gcc would have generated a file called "a.out". ("man gcc" for more info) Lastly, you can execute the file "cprog" by typing "./cprog" into the terminal. This means to check the directory "./" (which means the current directory that you are in) for the file "cprog". If you didn't specify that "cprog" was in "./", then the operating system would have assumed "cprog" was in "/usr/bin" or another directory (if you want to know type "$PATH" into your terminal). Does that explain things clearly? |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|