2
votes

I'm trying to follow the instructions from Here.

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.

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.

Any help appreciated.

1

1 Answers

1
votes

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

Ended up installing the libraries and simply linking them to Xcode, as described in the answer here


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. Get the googletest framework

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

2. Unzip and build google test

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

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

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