![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
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 |
| Compile gcc on AIX 5.2 | untamed | AIX | 7 | 01-31-2008 05:21 AM |
| How do I compile source undfer Suse Linux? | Mark Ward | SuSE | 3 | 05-26-2006 01:28 PM |
| ¿compile .ksh? | DebianJ | Shell Programming and Scripting | 1 | 05-09-2005 04:33 PM |
| Compile freeBSD binaries in Linux | shalmoo | High Level Programming | 0 | 10-01-2003 03:38 AM |
| How to compile using gcc... | lilprogrammer | High Level Programming | 4 | 08-22-2002 12:48 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
hi everyone,
i am a beginner of C and doing a subject which involved c programming under unix. i tried compile the c program under linux. but i can only get the a.out file in /usr/bin, not in the current dir. can anyone know how to change the sys. configration. Please help. thanks |
|
||||
|
The C compiler does not know what to call your final executable, so it has defaulted the name to a.out.
It is unusual for the compiler to place the output in the /usr/bin directory, usually it is placed into your current directory. Nearly all compiliers, including those on Unix and Linux will accept a number of command line switches and parameters. By using command line parameters you can change the behaviour of the compiler significantly. See for yourself by doing: man cc or man gcc This will give you a very lengthy description of what to expect from your compiler. Also read the man page on your linker. man ld Somewhere in that lot will be a way to change the output file name. If necessary you can give it an explicit path name. Finally, if you did not realise it already, the a.out file is (or should be) a fully runnable executable. You can always rename it using the move or copy command! Regards MBB. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|