g++ server.cpp-Wall

g++ server.cpp-Wall

LinuxにC ++で書かれたプログラムがあります。私はVimエディタをダウンロードし、次のコマンドを実行してコンパイルしました。

g++ server.cpp -Wall 

実行に来たら使用し./aますが、

機能しない場合は、ファイルを実行するための正しいコマンドを提供できます。

ありがとうございます。

ベストアンサー1

a.outマンページによると、デフォルトの実行可能ファイル名は次のとおりですg++

-o file

    Place output in file file.  This applies to whatever sort
    of output is being produced, whether it be an executable file,
    an object file, an assembler file or preprocessed C code.

    If -o is not specified, the default is to put an executable file
    in a.out, the object file for source.suffix in source.o, its
    assembler file in source.s, a precompiled header file in
    source.suffix.gch, and all preprocessed C source on standard output.

したがって、次のように./a.outコンパイルされた実行可能ファイルを実行したり、コマンドライン-oに引数を追加したりできます。g++

$ g++ -o server server.cpp -Wall
$ ./server

おすすめ記事