468,513 Members | 1,403 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,513 developers. It's quick & easy.

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.
Feb 16 '08 #1
2 5172
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
Feb 16 '08 #2
On 16 Vas, 16:51, Sreenivas <thatiparthysreeni...@gmail.comwrote:
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<module_file>
After you have all modules and main program compiled, link them.
g++ -o <program_name[file1.o, file2.o, ...]
Feb 16 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

52 posts views Thread by entropy123 | last post: by
8 posts views Thread by mohammaditraders | last post: by
reply views Thread by NPC403 | last post: by
1 post views Thread by fmendoza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.