Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

need help with gcc compiler

sputniksputnik Posts: 2Member
i am new to linux and i am trying out to program in c using the gcc compiler, my question is that why cant i run my compiled program.
it says that a.out command doesnt exist

Comments

  • ITAITA Posts: 463Member
    [b][red]This message was edited by ITA at 2004-9-25 5:26:42[/red][/b][hr]
    To compile a program with GCC do this:

    gcc [file] -o [output-file-name]

    (If you want to compile a C++ app use g++)

    To access the file type this command:
    ./[output-file-name]
    (Inside your directory) - DON'T just type the filename because IT WILL give an error (I'm not sure why).

    (Where [output-file-name] is the name of the output file {- if this is not specified it defaults to a.out} and [file] refers to the source to be compiled).

    That *should* work.

    I had the same trouble - if that doesn't work keep asking and give any error messages which you recieve.

    Hope this helps.

    ITA


  • sputniksputnik Posts: 2Member

    thanks ITA it worked i appreciate your help

    : [b][red]This message was edited by ITA at 2004-9-25 5:26:42[/red][/b][hr]
    : To compile a program with GCC do this:
    :
    : gcc [file] -o [output-file-name]
    :
    : (If you want to compile a C++ app use g++)
    :
    : To access the file type this command:
    : ./[output-file-name]
    : (Inside your directory) - DON'T just type the filename because IT WILL give an error (I'm not sure why).
    :
    : (Where [output-file-name] is the name of the output file {- if this is not specified it defaults to a.out} and [file] refers to the source to be compiled).
    :
    : That *should* work.
    :
    : I had the same trouble - if that doesn't work keep asking and give any error messages which you recieve.
    :
    : Hope this helps.
    :
    : ITA
    :
    :
    :

Sign In or Register to comment.