1

テスト ケースで Google テストをコンパイルしようとしていますが、できませんでした。gtest_main.cc または gtest-all.cc ファイルに変更を加えていませんが、これらのファイルをコンパイルできません。次のエラーが表示されます。

g++ -g -Wall -Wextra -Werror -I../../../ext/gtest-1.6.0/include -I../../../ext/gtest-1.6.0 -c ../../../ext/gtest-1.6.0/src/gtest-all.cc
In file included from ../../../ext/gtest-1.6.0/src/gtest.cc:35,
             from ../../../ext/gtest-1.6.0/src/gtest-all.cc:42:
../../../ext/gtest-1.6.0/include/gtest/gtest-spi.h:52: error: expected initializer before ‘:’ token
In file included from /usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../include/c++/4.4.4/ext/atomicity.h:34,
             from /usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../include/c++/4.4.4/bits/ios_base.h:41,
             from /usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../include/c++/4.4.4/ios:43,
             from /usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../include/c++/4.4.4/ostream:40,
             from ../../../ext/gtest-1.6.0/src/gtest.cc:46,
             from ../../../ext/gtest-1.6.0/src/gtest-all.cc:42:
/usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../include/c++/4.4.4/x86_64-redhat-linux/bits/gthr.h:30: error: expected ‘}’ before end of line
/usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../include/c++/4.4.4/x86_64-redhat-linux/bits/gthr.h:30: error: expected declaration before end of line

しかし、エラーなしで gtest_main.cc をコンパイルできました。

   g++ -g -Wall -Wextra -Werror -I../../../ext/gtest-1.6.0/include -I../../../ext/gtest-1.6.0 -c ../../../ext/gtest-1.6.0/src/gtest-all.cc

グーグルからのヘルプも見つかりませんでした..!! 事前に助けてくれてありがとう。

4

1 に答える 1