473,503 Members | 2,150 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5571
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2583
by: kaiwing18 | last post by:
Hi , I have a problem relate to java and database. Could anyone answer me ?Please see the following code. import java.sql.*; public class Result { public static void main(String args) {
12
3400
by: jrefactors | last post by:
If the C programs have UNIX system calls such as fork(), alarm(), etc.., we should call it UNIX programs, not traditional C programs? We couldn't compile the programs with system calls using VC++...
10
4419
by: Jean-David Beyer | last post by:
I have some programs running on Red Hat Linux 7.3 working with IBM DB2 V6.1 (with all the FixPacks) on my old machine. I have just installed IBM DB2 V8.1 on this (new) machine running Red Hat...
52
6749
by: entropy123 | last post by:
Hey all, I'm working with some legacy C code and I would like to compile it as a CPP file. I get the following error message: driver.cpp:87: cannot convert `void *' to `GenericStruct *' in...
23
1996
by: novice | last post by:
I dint find a proper group to post this, so i'm asking this question. If you think this question is irrelevent then dont answer, but i expect good replies from experts. I wondor, how these guys...
8
2299
by: mohammaditraders | last post by:
#include <iostream.h> #include <stdlib.h> #include <conio.h> #include <string.h> class Matrix { private : int numRows, numCols ; int elements ;
16
9124
by: pereges | last post by:
Do you see anything wrong about this method ? For eg. I write a shell script a.sh containing : cc -o test file1.c file2.c file3.c and then execute the shell script ( sh a.sh) to compile and...
0
7205
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7093
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7287
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7349
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
5022
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4688
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3168
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1521
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
399
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.