1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

VSCodeでCMakeのログが文字化けする

Last updated at Posted at 2021-04-29

問題

Visual Studio 2019を更新した後、VSCodeでcmake-tools&CMake&Visual C++でビルドしたところ、いきなり文字化けするようになりました。

[build] cl : �R�}���h ���C�� warning D9025 : '/W3' ��� '/W4' ���D�悳��܂��B

Visual Studio側の問題かと思い調べたのですが、どうやらCMakeがUTF8を仮定している一方で、Visual C++の出力はシステムの規定のコードページ(私の場合はShift-JISでした)に従うことが理由のようです。
microsoft/vscode-cmake-tools: output message is garbled #153

なぜ更新前に問題が起きなかったんだ…

解決方法

VSCodeの設定ファイルでエンコーディングを指定します。

settings.json
{
    "cmake.outputLogEncoding": "shift-jis"
}

すると文字化けが治ります。

[build] cl : コマンド ライン warning D9025 : '/W3' より '/W4' が優先されます。
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?