2012-12-20 74 views
1

我試圖使用autotools將Google測試框架添加到我的應用程序。 但我得到了一些stange錯誤。 在configure.ac:C++ Autotools Google測試框架

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是默認包含。

+0

顯然是gcc中的一個bug! 所以,我的猜測是,這些文件實際上並不存在,或者不能從您正在使用的帳戶讀取... –

回答

1

<limits>是一個C++頭文件,可能意味着gtest.h是C++頭文件,這意味着Google測試框架是用C++編寫的。您需要使用C++編譯器來檢測標頭的可用性。

請參閱this answer瞭解有關如何使用自動工具解決此問題的詳細信息。