Last-modified: 2014-11-16 (日) 02:08:58
Clang/インストール

概要

Ubuntu+ClangでC++コードをビルドできる環境を作成します。

手順

  1. インストール
    Everything is expanded.Everything is shortened.
      1
      2
    
     
     
    
    sudo apt-get update
    sudo apt-get install clang libclang-dev libc++-dev
  2. 動作確認用コード作成
    test.cppとして作成
    Everything is expanded.Everything is shortened.
      1
      2
      3
      4
      5
      6
      7
      8
      9
    
     
     
     
     
     
    -
    |
    |
    !
    
    #include <iostream>
     
    using namespace std;
     
    int main()
    {
        cout << "foo\n";
        return 0;
    }
  3. コンパイル&実行
    Everything is expanded.Everything is shortened.
      1
      2
    
     
     
    
    clang++ -stdlib=libc++ -Weverything test.cpp -o test
    ./test

検証時の環境