不能让gtest与Xcode 6.2一起使用 [英] Cant get gtest working with Xcode 6.2

查看:85
本文介绍了不能让gtest与Xcode 6.2一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试遵循此处的说明.

这些指令看起来非常简单,但是我无法编译它.如果我从网站上下载了gtest文件,可能会发现include目录中缺少头文件,这意味着它们不会进入gtest-framework中. 文件是gtest-port-arch.h,以及内部/自定义文件夹中的所有文件.我收到找不到这些文件的编译器错误.

The instructions seem very straight forward, but I can't get it to compile. If I download the gtest file from the website, it appears there are header files missing from the include directory which means they don't get into the gtest-framework. the files are the gtest-port-arch.h and everything in the internal/custom folder. I get complier errors that these files are not found.

如果我从svn获取源代码,则所有文件都存在于sdk的include目录中,但是,xcode项目中的源文件夹省略了将相同文件添加到项目中的操作.我必须自己添加它们,然后构建框架.然后会出现缺少的文件,但是当我构建gtest-framework并将其添加到测试项目中时,Test目标的主类无法识别TEST调用,并且出现类似C ++的错误,要求定义所有类型.我正在按照步骤进行.我真的需要使该框架正常工作.

If I get the source from the svn, all of the files are present in the include dir of the sdk, however, the source folder in the xcode project omits the same files from being added to the project. I have to add them myself then build the frame work. The missing files are then present, but when I build the gtest-framework and add it to the test project, then the Test target's main class does not recognize the TEST calls and I get errors like C++ requires all types to be defined. I am following the steps. I really need to get this framework functioning.

任何帮助表示赞赏.

推荐答案

我遇到了同样的问题,无法找到问题所在.

I had the same issue and couldn't find out the problem.

按照答案我也在此处复制说明.唯一的区别是我使用了/usr/ local /include和/usr/ local /lib

I copy the instructions here too. The only difference is that I used /usr/local/include and /usr/local/lib

此外,别忘了为您的测试"目标设置这些设置:

Moreover, do not forget to set these for your "Tests" target:

Library search paths:  /usr/local/lib
User header search paths: /usr/local/include
other linker flags: -lgtest

已复制:

Copied:

1..获取googletest框架

1. Get the googletest framework

$ wget http://googletest.googlecode.com/files/gtest-1.7.0.zip

2.解压缩并构建Google测试

2. Unzip and build google test

$ unzip gtest-1.7.0.zip
$ cd gtest-1.7.0
$ ./configure
$ make

3..在系统上安装"标头和库.

3. "Install" the headers and libs on your system.

$ sudo cp -a include/gtest /usr/include
$ sudo cp -a lib/.libs/* /usr/lib/

这篇关于不能让gtest与Xcode 6.2一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆