LoginSignup
0
0

More than 5 years have passed since last update.

WSL 上でgoogle Test のビルドに失敗した時にやったこと

Last updated at Posted at 2018-11-04

WSL 上でgoogle Test のビルドに失敗した時にやったこと

環境

  • Ubuntu(windows subsystem on linux)
mtan@zachlo:~/workspace/google-test-env/googletest/build$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.2 LTS"

ビルドに失敗した時に起こったこと

cmakeでビルドする際に以下のようなビルドエラーが発生。

This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.

原因は cmakeが指定していしたコンパイラがg++ではなく、c++というc++11に
未対応のコンパイラが指定されていたことと思われる。1

対処

cmake するときに以下にようにコマンドオプションを追加。
無事、google test をビルドできた。

cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ ..

  1. このエラーを受けて、「-std=c++11」をフラグに追加してみたが、同じビルドエラーが出た。やり方が悪かったか? 

0
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
0
0