Skip to content
This repository has been archived by the owner on Mar 15, 2018. It is now read-only.

gtest does not compile on Mavericks #4

Open
Lenskiy opened this issue Oct 30, 2013 · 4 comments
Open

gtest does not compile on Mavericks #4

Lenskiy opened this issue Oct 30, 2013 · 4 comments

Comments

@Lenskiy
Copy link
Contributor

Lenskiy commented Oct 30, 2013

gtest produces the following error during compilation on OSX 10.9

In file included from src/gtest-all.cc:39:
In file included from ./include/gtest/gtest.h:57:
In file included from ./include/gtest/internal/gtest-internal.h:40:
./include/gtest/internal/gtest-port.h:460:10: fatal error: 'tr1/tuple' file not found
#include <tr1/tuple>  // NOLINT

to make it compile the follow flag should be set up.
CPPFLAGS = -DGTEST_HAS_TR1_TUPLE=0

@wjwwood
Copy link
Member

wjwwood commented Oct 30, 2013

Ok, do you have a pull request by chance?

Long term we should really fix the way gtest is being provided on OS X. The recommendation is not to build it separately from your code you are testing, but rather have the gtest formulae provide the source files and have each project compile it in. For example, the Ubuntu package just installs a single source file.

See:

https://code.google.com/p/googletest/wiki/FAQ#Why_is_it_not_recommended_to_install_a_pre-compiled_copy_of_Goog

@woody242
Copy link

How do I apply the CPPFLAGS to get brew to use them.

@enriquefernandez
Copy link

Apparently somebody patched the homebrew formula for gtest that already includes the TR1_TUPLE fix and other linking error fixes.

Doing

brew remove gtest
brew install gtest

and compiling again with the catkin_make_isolated command fixed these kind of errors for me.

@keshavbashyal
Copy link

@Lenskiy How to setup CPPFLAGS flag? I am getting the error.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants