2

During a build process (unit tests) there are a bunch of errors like:
"error: no member named 'xxx' in the global namespace using::xxx;" ('xxx' is a type, e.g. uint8_t).

DETAILS:

  • in case if I include only <boost/test/unit_test.hpp>, the source of error is in the file /Library/Developer/CommandLineTools/usr/include/c++/v1/cstdint
  • in case if I include <boost/cstdint.hpp> before , the source of error is in the file /usr/local/include/boost/cstdint.hpp

ENVIRONMENT:

  • macOS Mojave
  • compiler: clang
  • CXX_STANDARD: 11 / 14
  • boost v.1.67.0_1 (installed using homebrew to default location - usr/local/Cellar/)

UPD: The same issue (with cstdint) happens with using Google Test (1.8.1)

4

1 回答 1

1

在解决这个问题一段时间后,我重新安装了操作系统。现在我有 Boost 和 Google Test 并行工作。

我不能 100% 确定问题的原因,但我比较了usr/local/include重新安装前后的文件夹。我发现有很多.cpp.h文件,并且cstdint.hpp在其中。现在usr/local/include文件夹只包含 boost、gmock 和 gtest 的符号链接。

于 2018-10-25T19:43:32.470 回答