简体   繁体   中英

How to run .cc extension file in linux?

I have main.cc file and i would like to run this file in linux. May i know what would be the correct way of executing this file ? Is it

 gcc -ox main.cc 

? Any help or feedback is appreciated.

The command you gave will compile the file. The resulting executable is put in x . To run it, you do:

./x

In your case it would be gcc main.cc -o main.ou where main.cc is your main-file and main.ou your output file.

You can also read more about executing c/c++ files here: http://www.cyberciti.biz/faq/compiling-c-program-and-creating-executable-file/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM