I dont know how to compile cpp programs with gcc

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sreenivas

    I dont know how to compile cpp programs with gcc

    I dont know how to compile cpp programs with gcc as i am new to gcc
    and cpp.
    could anybody help me out?
    Thanks&Regards,
    Srinivas Reddy Thatiparthy.
  • Bo Persson

    #2
    Re: I dont know how to compile cpp programs with gcc

    Sreenivas wrote:
    I dont know how to compile cpp programs with gcc as i am new to gcc
    and cpp.
    could anybody help me out?
    Thanks&Regards,
    Srinivas Reddy Thatiparthy.
    This group is really about the language, and not about using any
    particular tools.

    You could start by trying

    gcc --help

    and be welcome back when you have a program that does not compile or
    work properly.


    Bo Persson


    Comment

    • david

      #3
      Re: I dont know how to compile cpp programs with gcc

      On 16 Vas, 16:51, Sreenivas <thatiparthysre eni...@gmail.co mwrote:
      I dont know how to compile cpp programs with gcc as i am new to gcc
      and cpp.
      could anybody help me out?
      Thanks&Regards,
      Srinivas Reddy Thatiparthy.
      Use gcc for C and for C++ use g++.

      g++ -Wall -ansi -pedantic -o <name[file1, file2, ...]

      But if you want to do it in correct way first of all you should build
      Obj files.
      g++ -Wall -ansi -pedantic -o <module_name<mo dule_file>
      After you have all modules and main program compiled, link them.
      g++ -o <program_name[file1.o, file2.o, ...]

      Comment

      Working...