How do I compile C++ with Clang?

后端 未结 6 1343
陌清茗
陌清茗 2020-12-12 16:37

I have installed Clang by using apt-get in Ubuntu, and I can successfully compile C files using it. However, I have no idea how to compile C++ through it. What do I need to

6条回答
  •  时光说笑
    2020-12-12 17:20

    Also, for posterity -- Clang (like GCC) accepts the -x switch to set the language of the input files, for example,

    $ clang -x c++ some_random_file.txt
    

    This mailing list thread explains the difference between clang and clang++ well: Difference between clang and clang++

提交回复
热议问题