Discussion:
a silly question
Yiming CHU
2014-07-13 03:25:39 UTC
Permalink
Dear GCC team,

I am really a newcomer, so I am wondering how to compile this source
code in the attachment.

Regards,
Yiming CHU
Prathamesh Kulkarni
2014-07-13 09:15:55 UTC
Permalink
Post by Yiming CHU
Dear GCC team,
I am really a newcomer, so I am wondering how to compile this source
code in the attachment.
Hi,
Make sure you have g++ installed. If you use ubuntu, this can be done by:
sudo apt-get install g++
if you use linux/command-line, type the following command to compile 1.cc:
g++ 1.cc
This will create executable called a.out
Run the program by:
./a.out

btw it's a good idea to compile with full warnings turned on, so i
would compile with:
g++ -Wall -Wextra 1.cc

Thanks,
Prathamesh
Post by Yiming CHU
Regards,
Yiming CHU
Yiming CHU
2014-07-15 11:10:08 UTC
Permalink
Hi,
thanks a lot! BTW, everything is functioning quite well since then and I
am learning(slowly of course:-P) via the gcc document and err.... Well,
you know.
Best regards,
Yiming
Post by Prathamesh Kulkarni
Post by Yiming CHU
Dear GCC team,
I am really a newcomer, so I am wondering how to compile this source
code in the attachment.
Hi,
sudo apt-get install g++
g++ 1.cc
This will create executable called a.out
./a.out
btw it's a good idea to compile with full warnings turned on, so i
g++ -Wall -Wextra 1.cc
Thanks,
Prathamesh
Post by Yiming CHU
Regards,
Yiming CHU
Loading...