Mailing List Archive

Support open source code!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Compiling an Executable



   Would greatly appreciate someone filling me in on how to compile an
   executable.  I am running 1.2.13 ( Red Hat ) with gcc 2.7.0. The
   kernal has been compiled to support both ELF and a.out.

   When compiling I have tried to use the -i486-linuxaout and without. 
   It compiles cleanly ( "hello world" equivalent ) but the result is
   not executable.

For "hello world", "gcc hello.c" should do the trick.  This
automatically runs (some subset of) cpp, cc1, gas, and ld to produce
an executable.

Please give the exact command line you are using when you do this.
For example, if you are doing something like "gcc -c hello.c -o hello",
you will indeed produce a non-executable object.

Also give the error message you get when trying to run the object.  I
*think* that gcc does a chmod on executable objects, but you may need
to do a "chmod o+x hello" to get it to run.  Do "ls -l" and make sure
the necessary executable bit is set.

-- 
                            Stephen J. Turnbull
Institute of Policy and Planning Sciences                    Yaseppochi-Gumi
University of Tsukuba                      http://turnbull.sk.tsukuba.ac.jp/
Tennodai 1-1-1, Tsukuba, 305 JAPAN                 turnbull@example.com


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links