在OSX Sierra上找不到C ++头文件

时间:2016-11-20 08:38:54

标签: c++ xcode macos macos-sierra

我尝试使用CMake编译程序,并获得以下输出:

make VERBOSE=1
Re-run cmake no build system arguments
-- Found ccache /usr/local/osquery/bin/ccache
-- Using ccache to speed up compilation
-- The C compiler identification is Clang 3.8.0
-- The CXX compiler identification is Clang 3.8.0
-- Check for working C compiler: /usr/local/bin/clang
-- Check for working C compiler: /usr/local/bin/clang -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/local/bin/clang++
-- Check for working CXX compiler: /usr/local/bin/clang++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Welcome to osquery's build-- thank you for your patience! :)
-- For a brief tutorial see: http://osquery.readthedocs.io/en/stable/development/building/
-- If at first you dont succeed, perhaps: make distclean; make depsclean
-- Building for platform OS X (darwin, 10.12)
-- Building osquery version  1.6.2-801-gd402a6a sdk 1.6.2
-- Looking for C++ include tr1/tuple
-- Looking for C++ include tr1/tuple - not found
-- Found PythonInterp: /usr/local/osquery/bin/python (found version "2.7.12")
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE
-- Found library /usr/lib/libpthread.dylib
-- Found library /usr/lib/libz.dylib
-- Found library /usr/local/osquery/lib/libboost_system-mt.a
-- Found library /usr/local/osquery/lib/libboost_filesystem-mt.a
-- Found library /usr/local/osquery/lib/libgflags.a
-- Found library /usr/local/osquery/lib/libthrift.a
-- Found library /usr/local/osquery/lib/liblz4.a
-- Found library /usr/local/osquery/lib/libglog.a
-- Found library /usr/lib/libdl.dylib
-- Found library /usr/local/osquery/lib/libcppnetlib-uri.a
-- Found library /usr/local/osquery/lib/libcppnetlib-client-connections.a
-- Found library /usr/local/osquery/lib/libboost_regex-mt.a
-- Found library /usr/local/osquery/lib/librocksdb_lite.a
-- Found library /usr/local/osquery/lib/libsnappy.a
-- Found library /usr/local/osquery/lib/libssl.a
-- Found library /usr/local/osquery/lib/libyara.a
-- Found library /usr/local/osquery/lib/libcrypto.a
-- Found library /usr/local/osquery/lib/liblinenoise.a
-- Found library /usr/lib/liblzma.dylib
-- Found library /usr/lib/libbz2.dylib
-- Found library /usr/local/osquery/lib/libaws-cpp-sdk-kinesis.a
-- Found library /usr/local/osquery/lib/libaws-cpp-sdk-firehose.a
-- Found library /usr/local/osquery/lib/libaws-cpp-sdk-sts.a
-- Found library /usr/local/osquery/lib/libaws-cpp-sdk-core.a
-- Found library /usr/lib/libresolv.dylib
-- Found library /usr/lib/libxar.dylib
-- Found library /usr/local/osquery/lib/libmagic.a
-- Found library /usr/local/osquery/lib/libtsk.a
-- Found library /usr/local/osquery/lib/libaugeas.a
-- Found library /usr/local/osquery/lib/libfa.a
-- Found library /usr/local/osquery/lib/libxml2.a
-- Found library /usr/lib/libiconv.dylib
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/omer.katz/Documents/osquery/build/darwin10.12
/usr/local/osquery/Cellar/cmake/3.6.1_1/bin/cmake -H/Users/omer.katz/Documents/osquery -B/Users/omer.katz/Documents/osquery/build/darwin10.12 --check-build-system CMakeFiles/Makefile.cmake 0
/usr/local/osquery/Cellar/cmake/3.6.1_1/bin/cmake -E cmake_progress_start /Users/omer.katz/Documents/osquery/build/darwin10.12/CMakeFiles /Users/omer.katz/Documents/osquery/build/darwin10.12/CMakeFiles/progress.marks
/Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/Makefile2 all
/Library/Developer/CommandLineTools/usr/bin/make -f third-party/sqlite3/CMakeFiles/osquery_sqlite.dir/build.make third-party/sqlite3/CMakeFiles/osquery_sqlite.dir/depend
cd /Users/omer.katz/Documents/osquery/build/darwin10.12 && /usr/local/osquery/Cellar/cmake/3.6.1_1/bin/cmake -E cmake_depends "Unix Makefiles" /Users/omer.katz/Documents/osquery /Users/omer.katz/Documents/osquery/third-party/sqlite3 /Users/omer.katz/Documents/osquery/build/darwin10.12 /Users/omer.katz/Documents/osquery/build/darwin10.12/third-party/sqlite3 /Users/omer.katz/Documents/osquery/build/darwin10.12/third-party/sqlite3/CMakeFiles/osquery_sqlite.dir/DependInfo.cmake --color=
Dependee "/Users/omer.katz/Documents/osquery/build/darwin10.12/third-party/sqlite3/CMakeFiles/osquery_sqlite.dir/DependInfo.cmake" is newer than depender "/Users/omer.katz/Documents/osquery/build/darwin10.12/third-party/sqlite3/CMakeFiles/osquery_sqlite.dir/depend.internal".
Dependee "/Users/omer.katz/Documents/osquery/build/darwin10.12/third-party/sqlite3/CMakeFiles/CMakeDirectoryInformation.cmake" is newer than depender "/Users/omer.katz/Documents/osquery/build/darwin10.12/third-party/sqlite3/CMakeFiles/osquery_sqlite.dir/depend.internal".
Scanning dependencies of target osquery_sqlite
/Library/Developer/CommandLineTools/usr/bin/make -f third-party/sqlite3/CMakeFiles/osquery_sqlite.dir/build.make third-party/sqlite3/CMakeFiles/osquery_sqlite.dir/build
[  0%] Building C object third-party/sqlite3/CMakeFiles/osquery_sqlite.dir/sqlite3.c.o
cd /Users/omer.katz/Documents/osquery/build/darwin10.12/third-party/sqlite3 && /usr/local/osquery/bin/ccache /usr/local/bin/clang  -DBOOST_NETWORK_ENABLE_HTTPS -DBOOST_NO_CXX11_VARIADIC_TEMPLATES -DDARWIN -DDARWIN_10_12 -DNDEBUG -DOSQUERY_BUILD_DISTRO=10.12 -DOSQUERY_BUILD_PLATFORM=darwin -DOSQUERY_BUILD_SDK_VERSION=1.6.2 -DOSQUERY_THRIFT="" -DOSQUERY_THRIFT_LIB=thrift -DOSQUERY_THRIFT_POINTER=boost -DOSQUERY_THRIFT_SERVER_LIB=thrift/server -DSQLITE_DISABLE_DIRSYNC -DSQLITE_DISABLE_FTS3_UNICODE -DSQLITE_DISABLE_FTS4_DEFERRED -DSQLITE_DISABLE_LFS -DSQLITE_ENABLE_API_ARMOR -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_OMIT_AUTHORIZATION -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_LOOKASIDE -DSQLITE_OMIT_SHARED_CACHE -DSTRIP_FLAG_HELP=1 -isystem /Users/omer.katz/Documents/osquery/third-party/sysroots/darwin -isystem /usr/local/osquery/legacy/include -isystem /usr/local/osquery/include -I/usr/local/osquery/include/openssl -I/Users/omer.katz/Documents/osquery/third-party/sqlite3 -I/Users/omer.katz/Documents/osquery/include -I/Users/omer.katz/Documents/osquery -I/Users/omer.katz/Documents/osquery/build/darwin10.12/generated/gen-cpp  -Qunused-arguments -Wstrict-aliasing -Wno-missing-field-initializers -Wno-unused-local-typedef -Wno-deprecated-register -Wno-unknown-warning-option -Wnon-virtual-dtor -Wchar-subscripts -Wpointer-arith -Woverloaded-virtual -Wformat -Wformat-security -Werror=format-security -Wabi-tag -fpermissive -fstack-protector-all -pipe -fdata-sections -ffunction-sections -mmacosx-version-min=10.12 -Os -fPIE -fpie -fPIC -fpic -march=x86-64 -mno-avx -Wno-parentheses-equality -Wno-unused-value -o CMakeFiles/osquery_sqlite.dir/sqlite3.c.o   -c /Users/omer.katz/Documents/osquery/third-party/sqlite3/sqlite3.c
/Users/omer.katz/Documents/osquery/third-party/sqlite3/sqlite3.c:20330:17: warning: 'OSAtomicCompareAndSwapPtrBarrier' is deprecated: first deprecated in OS X 10.12 - Use atomic_compare_exchange_strong() from <stdatomic.h> instead [-Wdeprecated-declarations]
      success = OSAtomicCompareAndSwapPtrBarrier(NULL, newzone,
                ^
/usr/include/libkern/OSAtomicDeprecated.h:547:6: note: 'OSAtomicCompareAndSwapPtrBarrier' has been explicitly marked deprecated here
bool    OSAtomicCompareAndSwapPtrBarrier( void *__oldValue, void *__newValue, void * volatile *__theValue );
        ^
1 warning generated.
[  0%] Built target osquery_sqlite
/Library/Developer/CommandLineTools/usr/bin/make -f third-party/gmock-1.7.0/CMakeFiles/gmock_main.dir/build.make third-party/gmock-1.7.0/CMakeFiles/gmock_main.dir/depend
cd /Users/omer.katz/Documents/osquery/build/darwin10.12 && /usr/local/osquery/Cellar/cmake/3.6.1_1/bin/cmake -E cmake_depends "Unix Makefiles" /Users/omer.katz/Documents/osquery /Users/omer.katz/Documents/osquery/third-party/gmock-1.7.0 /Users/omer.katz/Documents/osquery/build/darwin10.12 /Users/omer.katz/Documents/osquery/build/darwin10.12/third-party/gmock-1.7.0 /Users/omer.katz/Documents/osquery/build/darwin10.12/third-party/gmock-1.7.0/CMakeFiles/gmock_main.dir/DependInfo.cmake --color=
Dependee "/Users/omer.katz/Documents/osquery/build/darwin10.12/third-party/gmock-1.7.0/CMakeFiles/gmock_main.dir/DependInfo.cmake" is newer than depender "/Users/omer.katz/Documents/osquery/build/darwin10.12/third-party/gmock-1.7.0/CMakeFiles/gmock_main.dir/depend.internal".
Dependee "/Users/omer.katz/Documents/osquery/build/darwin10.12/third-party/gmock-1.7.0/CMakeFiles/CMakeDirectoryInformation.cmake" is newer than depender "/Users/omer.katz/Documents/osquery/build/darwin10.12/third-party/gmock-1.7.0/CMakeFiles/gmock_main.dir/depend.internal".
Scanning dependencies of target gmock_main
/Library/Developer/CommandLineTools/usr/bin/make -f third-party/gmock-1.7.0/CMakeFiles/gmock_main.dir/build.make third-party/gmock-1.7.0/CMakeFiles/gmock_main.dir/build
[  0%] Building CXX object third-party/gmock-1.7.0/CMakeFiles/gmock_main.dir/gtest/src/gtest-all.cc.o
cd /Users/omer.katz/Documents/osquery/build/darwin10.12/third-party/gmock-1.7.0 && /usr/local/osquery/bin/ccache /usr/local/bin/clang++   -DBOOST_NETWORK_ENABLE_HTTPS -DBOOST_NO_CXX11_VARIADIC_TEMPLATES -DDARWIN -DDARWIN_10_12 -DNDEBUG -DOSQUERY_BUILD_DISTRO=10.12 -DOSQUERY_BUILD_PLATFORM=darwin -DOSQUERY_BUILD_SDK_VERSION=1.6.2 -DOSQUERY_THRIFT="" -DOSQUERY_THRIFT_LIB=thrift -DOSQUERY_THRIFT_POINTER=boost -DOSQUERY_THRIFT_SERVER_LIB=thrift/server -DSTRIP_FLAG_HELP=1 -isystem /Users/omer.katz/Documents/osquery/third-party/sysroots/darwin -isystem /usr/local/osquery/legacy/include -isystem /usr/local/osquery/include -I/usr/local/osquery/include/openssl -I/Users/omer.katz/Documents/osquery/third-party/sqlite3 -I/Users/omer.katz/Documents/osquery/include -I/Users/omer.katz/Documents/osquery -I/Users/omer.katz/Documents/osquery/build/darwin10.12/generated/gen-cpp -I/Users/omer.katz/Documents/osquery/third-party/gmock-1.7.0/include -I/Users/omer.katz/Documents/osquery/third-party/gmock-1.7.0 -I/Users/omer.katz/Documents/osquery/third-party/gmock-1.7.0/gtest/include -I/Users/omer.katz/Documents/osquery/third-party/gmock-1.7.0/gtest  -L/usr/local/osquery/lib    -L/usr/local/osquery/lib   -DGTEST_HAS_PTHREAD=1   -Qunused-arguments -Wstrict-aliasing -Wno-missing-field-initializers -Wno-unused-local-typedef -Wno-deprecated-register -Wno-unknown-warning-option -Wnon-virtual-dtor -Wchar-subscripts -Wpointer-arith -Woverloaded-virtual -Wformat -Wformat-security -Werror=format-security -Wabi-tag -fpermissive -fstack-protector-all -pipe -fdata-sections -ffunction-sections -mmacosx-version-min=10.12 -Os -fPIE -fpie -fPIC -fpic -march=x86-64 -mno-avx -o CMakeFiles/gmock_main.dir/gtest/src/gtest-all.cc.o -c /Users/omer.katz/Documents/osquery/third-party/gmock-1.7.0/gtest/src/gtest-all.cc
In file included from /Users/omer.katz/Documents/osquery/third-party/gmock-1.7.0/gtest/src/gtest-all.cc:39:
/Users/omer.katz/Documents/osquery/third-party/gmock-1.7.0/gtest/include/gtest/gtest.h:54:10: fatal error: 'limits' file not found
#include <limits>
         ^
1 error generated.
make[3]: *** [third-party/gmock-1.7.0/CMakeFiles/gmock_main.dir/gtest/src/gtest-all.cc.o] Error 1
make[2]: *** [third-party/gmock-1.7.0/CMakeFiles/gmock_main.dir/all] Error 2
make[1]: *** [all] Error 2
make: *** [all] Error 2

正确安装XCode

xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates

并且头文件存在。

可能是什么问题?它是我需要设置的环境变量吗?

2 个答案:

答案 0 :(得分:1)

/ usr / local / bin / clang不是系统clang安装的标准位置。

看起来你可能有一个腐败的安装。试试/ usr / bin中的那个,看看你是否有更好的运气。

或者在此处下载新版本:http://llvm.org/releases/download.html

我可以确认3.9版本是“解压缩并且去”并且它适用于sierra。

答案 1 :(得分:0)

这已经有一年多了,而且osquery构建系统已经有所改进。做一个'make dep&amp;&amp; make'将获得所有依赖项并构建osqueryi / osqueryd。这需要很长时间,但它非常稳固。