You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On a fresh macOS Big Sur install, with Googletest installed installed via Mac Ports, I get errors such as:
../utils/gtest/src/gtest-internal-inl.h:428:11: error: unknown type name 'string'; did you mean 'String'?
virtual string CurrentStackTrace(int max_depth, int skip_count) = 0;
^~~~~~
String
/opt/local/include/gtest/internal/gtest-string.h:58:18: note: 'String' declared here
class GTEST_API_ String {
^
In file included from ../utils/gtest/src/gtest-all.cc:42:
In file included from ../utils/gtest/src/gtest.cc:135:
../utils/gtest/src/gtest-internal-inl.h:444:11: error: unknown type name 'string'; did you mean 'String'?
virtual string CurrentStackTrace(int max_depth, int skip_count)
^~~~~~
String
/opt/local/include/gtest/internal/gtest-string.h:58:18: note: 'String' declared here
class GTEST_API_ String {
^
In file included from ../utils/gtest/src/gtest-all.cc:42:
In file included from ../utils/gtest/src/gtest.cc:135:
../utils/gtest/src/gtest-internal-inl.h:644:25: error: no type named 'SetUpTestCaseFunc' in 'testing::Test'; did you mean 'SetUpTestSuiteFunc'?
Test::SetUpTestCaseFunc set_up_tc,
^~~~~~~~~~~~~~~~~~~~~~~
SetUpTestSuiteFunc
/opt/local/include/gtest/internal/gtest-internal.h:477:7: note: 'SetUpTestSuiteFunc' declared here
using SetUpTestSuiteFunc = void (*)();
^
The reason for this is that zlib is installed via MacPorts, so ZLIB_INCLUDE_DIR gets expanded to /opt/local/include. If you have Googletest installed by MacPorts, then you also have gtest/gtest.h in /opt/local/include. Given that STP needs the zlib include dirs, the final compiler invocation looks like:
(notice that /opt/local/include is before../utils/gtest/include).
However, inside of ../utils/gtest/src/gtest-all.cc, the code does this:
#include "gtest/gtest.h"
However, because ../utils/gtest/src/gtest/gtest.hdoes not exist (the correct path should be ../utils/gtest/include/gtest/gtest.h), this then means that we find gtest in /opt/local/include, which then clashes with what's in ../utils/gtest/include, leading to compilation errors.
Description of issue
On a fresh macOS Big Sur install, with Googletest installed installed via Mac Ports, I get errors such as:
The reason for this is that zlib is installed via MacPorts, so
ZLIB_INCLUDE_DIR
gets expanded to/opt/local/include
. If you have Googletest installed by MacPorts, then you also havegtest/gtest.h
in/opt/local/include
. Given that STP needs the zlib include dirs, the final compiler invocation looks like:(notice that
/opt/local/include
is before../utils/gtest/include
).However, inside of
../utils/gtest/src/gtest-all.cc
, the code does this:However, because
../utils/gtest/src/gtest/gtest.h
does not exist (the correct path should be../utils/gtest/include/gtest/gtest.h
), this then means that we find gtest in/opt/local/include
, which then clashes with what's in../utils/gtest/include
, leading to compilation errors.Temporary workarounds
Temporary workaround 1 uninstall Googletest system-wide.
Temporary workaround 2 Add
-DENABLE_TESTING:BOOL=OFF
to yourcmake
invocation.The text was updated successfully, but these errors were encountered: