cygwin中编译gtest出错.水平不够看不出来问题,望大神指导.
在cygwin下编译gtest.
已经 export $GTEST_HOME=$HOME/test/common/gtest
编译中出现这样的错误. 在linux环境编译正常. 请大神指导一下.谢谢
~/test/common/gtest/make $make g++ -I.. -I../include -g -Wall -Wextra -c ../samples/sample1_unittest.cc In file included from ../include/gtest/gtest-param-test.h:159:0, from ../include/gtest/gtest.h:59, from ../samples/sample1_unittest.cc:48: ../include/gtest/internal/gtest-param-util-generated.h: In instantiation of ‘testing::internal::ValueArray2<T1, T2>::operator testing::internal::ParamGenerator<T>() const [with T = bool; T1 = bool; T2 = bool]’: ../include/gtest/gtest-param-test.h:1186:28: required from here ../include/gtest/internal/gtest-param-util-generated.h:80:26: 错误:‘ValuesIn’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive] return ValuesIn(array); ^ In file included from ../include/gtest/gtest.h:59:0, from ../samples/sample1_unittest.cc:48: ../include/gtest/gtest-param-test.h:288:58: 附注:‘template<class Container> testing::internal::ParamGenerator<typename Container::value_type> testing::ValuesIn(const Container&)’ declared here, later in the translation unit internal::ParamGenerator<typename Container::value_type> ValuesIn( ^ Makefile:75: recipe for target 'sample1_unittest.o' failed make: *** [sample1_unittest.o] Error 1
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最终还是自己解决了.只是解决问题,但问题所在还不是很清楚.
1. 该gtest是从protobuf中提取的,版本为1.4.0. 去go0glecode下载最新版本 1.7.0
2. 确定g++为cygwin g++, 且环境变量是干净的.
2.1 在计算机->属性->高级->环境变量中 看下有没有安装其他的C编译软件.如MinGW
或者在$PATH变量里看看有没有.
检查变量为:
C_INCLUDE_PATH
CPP_INCLUDE_PATH
LIBRARY_PATH
PATH
清除掉冗余项或者多义项
3. 安装最近g++ . 因为这个原因,我把整个镜像都ftp下来,差点没把磁盘弄爆.