2

I'm trying to add Google Test Framework to my app using autotools. But i got some stange errors for me. In configure.ac:

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

But in log I got:

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

Both files are exists. And as I know /usr/include is default include.

Sirex
  • 195
  • 2
  • 13
  • Clearly a bug in gcc! So, my guess is that either the files are not actually there, or not readable from the account you are using... – Mats Petersson Dec 20 '12 at 21:20

1 Answers1

2

<limits> is a C++ header, which probably signifies gtest.h is a C++ header which means the Google Test framework is written in C++. You'll need to use the C++ compiler to detect the usability of the header.

See this answer for details on how to work around this with autotools.

Community
  • 1
  • 1
rubenvb
  • 74,642
  • 33
  • 187
  • 332