How to compile C++ under Ubuntu Linux?

前端 未结 11 1914
伪装坚强ぢ
伪装坚强ぢ 2020-12-09 08:35

I cut&pasted the below code from a previous question into a file called \"avishay.cpp\" and then ran

gcc avishay.cpp

only to get the f

11条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-09 09:02

    Use

    g++

    space followed by the program name. e.g:

    g++ prog.cpp

    if the filename was "prog.cpp" in this case. if you want to run the program write:

    ./prog
    

    so i used

    "prog"

    because it was my filename.

提交回复
热议问题