By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,797 Members | 1,262 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,797 IT Pros & Developers. It's quick & easy.

I dont know how to compile cpp programs with gcc

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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.