【问题标题】:C++ Autotools Google test frameworkC++ Autotools 谷歌测试框架
【发布时间】:2012-12-20 21:06:11
【问题描述】:

我正在尝试使用自动工具将 Google 测试框架添加到我的应用中。 但是我遇到了一些奇怪的错误。 在configure.ac中:

AC_CHECK_HEADER([gtest/gtest.h], [AC_DEFINE([HAVE_GTEST_H], 1)])

但在日志中我得到了:

...
checking for limits.h... yes
checking gtest/gtest.h usability... no
checking gtest/gtest.h presence... no
checking for gtest/gtest.h... no

config.log:

configure:3276: checking gtest/gtest.h presence
configure:3276: gcc -E  conftest.c
In file included from conftest.c:19:0:
/usr/include/gtest/gtest.h:54:18: fatal error: limits: No such file or directory
compilation terminated.

两个文件都存在。据我所知 /usr/include 是默认包含。

【问题讨论】:

  • 显然是 gcc 中的一个错误! 所以,我的猜测是文件实际上并不存在,或者无法从您使用的帐户中读取...

标签: c++ autotools googletest


【解决方案1】:

<limits> 是 C++ 标头,这可能意味着 gtest.h 是 C++ 标头,这意味着 Google 测试框架是用 C++ 编写的。您需要使用 C++ 编译器来检测标头的可用性。

有关如何使用自动工具解决此问题的详细信息,请参阅 this answer

【讨论】:

    猜你喜欢
    • 2011-06-14
    • 2012-05-02
    • 2019-01-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多