Sirex
Sirex

Reputation: 305

C++ Autotools Google test framework

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.

Upvotes: 2

Views: 4146

Answers (1)

rubenvb
rubenvb

Reputation: 76519

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

Upvotes: 2

Related Questions