Using cc compiler

Hi everyone,

I'm going to compile my program with cc command on Linux terminal but I can't remember the format. by the way I used to use g++
in this way:

g++ test.cpp

and then

./a.out but now I enter


cc -c test.cpp

and file complie but I can't get the output after entering

./a.out

!!!
one of the error i received is

gcc.real: fatal error: cannot specify -o with -c, -S or -E with multiple files
compilation terminated.

after compiling with

cc -c test.pp -o test
g++ sorce1.cpp main.cpp -o run
I use this command for normal cpp files.

But my IDE use this command
g++ -Wall -o sorce1.cpp main.cpp

if you want to compile c++11 code add this at the end of command -std=c++0x
Last edited on
Topic archived. No new replies allowed.