Vcpkg: MacOS X 10.14.6 + XCode 11beta5 build failure on bootstrap

Created on 7 Aug 2019  路  16Comments  路  Source: microsoft/vcpkg

Describe the bug
A clear and concise description of what the bug is.

When bootstrapping vcpkg on MacOS X with the a recent Xcode beta installed, the compilation is failing.

Environment

  • OS: MacOS 10.14.6
  • Compiler: gcc 6.5.0_2 (installed via homebrew)

To Reproduce
Steps to reproduce the behavior:

  1. git clone https://github.com/microsoft/vcpkg/
  2. cd vcpkg
  3. ./bootstrap-vcpkg.sh

(specific commit at the time of this failure is 77c3e0aa2eb020e7b9602f8f373be7bb8d1b5aa6, but I don't think this is specific to the commit)

Expected behavior
normal successful build

Failure logs
Specific compilation error is

In file included from /Users/heckj/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/wchar.h:90:0,
                 from /usr/local/Cellar/gcc@6/6.5.0_2/include/c++/6.5.0/cwchar:44,
                 from /usr/local/Cellar/gcc@6/6.5.0_2/include/c++/6.5.0/bits/postypes.h:40,
                 from /usr/local/Cellar/gcc@6/6.5.0_2/include/c++/6.5.0/bits/char_traits.h:40,
                 from /usr/local/Cellar/gcc@6/6.5.0_2/include/c++/6.5.0/string:40,
                 from /usr/local/Cellar/gcc@6/6.5.0_2/include/c++/6.5.0/stdexcept:39,
                 from /usr/local/Cellar/gcc@6/6.5.0_2/include/c++/6.5.0/array:39,
                 from ../include/pch.h:31,
                 from ../src/vcpkg/base/checks.cpp:1:
/usr/local/Cellar/gcc@6/6.5.0_2/lib/gcc/6/gcc/x86_64-apple-darwin18.5.0/6.5.0/include-fixed/stdio.h:222:7: error: conflicting declaration of 'char* ctermid(char*)' with 'C' linkage
 char *ctermid(char *);
       ^~~~~~~

full build output attached:
build_output.txt

Additional context
Add any other context about the problem here.

port-bug

Most helpful comment

Ok. I found the solution. You have to install the missing headers by yourself:

$ sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /

After that the Vcpkg build runs as expected:

$ ./bootstrap-vcpkg.sh 
-- The C compiler identification is AppleClang 11.0.0.11000033
-- The CXX compiler identification is GNU 9.2.0
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Check for working CXX compiler: /usr/local/bin/g++-9
-- Check for working CXX compiler: /usr/local/bin/g++-9 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE  
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/ago/src/cpp/vcpkg/toolsrc/build.rel
[0/2] Re-checking globbed directories...
[66/66] Linking CXX executable vcpkg

All 16 comments

When I switch back to the built in/non-beta Xcode with the command:

  • sudo xcode-select -s /Applications/Xcode.app/Contents/Developer/
    the system compiles normally and correctly, so I fully expect this is due to the beta Xcode being included.

I didn't know if this presaged other issues in the future when this version of Xcode is released, so I wanted to report it.

I have the exact same problem like you but your solution by setting the active developer directory didn't fix the problem.

This is my build output on macOS Mojave 10.14.6 with Xcode 11 and compiler gcc 9.2.0 installed with brew install gcc:

-- The C compiler identification is AppleClang 11.0.0.11000033
-- The CXX compiler identification is GNU 9.2.0
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Check for working CXX compiler: /usr/local/bin/g++-9
-- Check for working CXX compiler: /usr/local/bin/g++-9 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE  
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/ago/src/cpp/vcpkg/toolsrc/build.rel
[0/2] Re-checking globbed directories...
[1/66] Building CXX object CMakeFiles/vcpkglib.dir/src/vcpkg/base/enums.cpp.o
FAILED: CMakeFiles/vcpkglib.dir/src/vcpkg/base/enums.cpp.o 
/usr/local/bin/g++-9  -DDISABLE_METRICS=0 -I../include -O3 -DNDEBUG -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.14   -std=c++1z -MD -MT CMakeFiles/vcpkglib.dir/src/vcpkg/base/enums.cpp.o -MF CMakeFiles/vcpkglib.dir/src/vcpkg/base/enums.cpp.o.d -o CMakeFiles/vcpkglib.dir/src/vcpkg/base/enums.cpp.o -c ../src/vcpkg/base/enums.cpp
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/wchar.h:90,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/cwchar:44,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/bits/postypes.h:40,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/bits/char_traits.h:40,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/string:40,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/stdexcept:39,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/array:39,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/tuple:39,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/functional:54,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/pstl/glue_algorithm_defs.h:13,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/algorithm:71,
                 from ../include/pch.h:22,
                 from ../src/vcpkg/base/enums.cpp:1:
/usr/local/Cellar/gcc/9.2.0/lib/gcc/9/gcc/x86_64-apple-darwin18/9.2.0/include-fixed/stdio.h:222:7: error: conflicting declaration of 'char* ctermid(char*)' with 'C' linkage
  222 | char *ctermid(char *);
      |       ^~~~~~~
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/unistd.h:525,
                 from ../include/pch.h:19,
                 from ../src/vcpkg/base/enums.cpp:1:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_ctermid.h:26:10: note: previous declaration with 'C++' linkage
   26 | char    *ctermid(char *);
      |          ^~~~~~~
[2/66] Building CXX object CMakeFiles/vcpkglib.dir/src/vcpkg/base/cofffilereader.cpp.o
FAILED: CMakeFiles/vcpkglib.dir/src/vcpkg/base/cofffilereader.cpp.o 
/usr/local/bin/g++-9  -DDISABLE_METRICS=0 -I../include -O3 -DNDEBUG -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.14   -std=c++1z -MD -MT CMakeFiles/vcpkglib.dir/src/vcpkg/base/cofffilereader.cpp.o -MF CMakeFiles/vcpkglib.dir/src/vcpkg/base/cofffilereader.cpp.o.d -o CMakeFiles/vcpkglib.dir/src/vcpkg/base/cofffilereader.cpp.o -c ../src/vcpkg/base/cofffilereader.cpp
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/wchar.h:90,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/cwchar:44,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/bits/postypes.h:40,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/bits/char_traits.h:40,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/string:40,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/stdexcept:39,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/array:39,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/tuple:39,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/functional:54,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/pstl/glue_algorithm_defs.h:13,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/algorithm:71,
                 from ../include/pch.h:22,
                 from ../src/vcpkg/base/cofffilereader.cpp:1:
/usr/local/Cellar/gcc/9.2.0/lib/gcc/9/gcc/x86_64-apple-darwin18/9.2.0/include-fixed/stdio.h:222:7: error: conflicting declaration of 'char* ctermid(char*)' with 'C' linkage
  222 | char *ctermid(char *);
      |       ^~~~~~~
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/unistd.h:525,
                 from ../include/pch.h:19,
                 from ../src/vcpkg/base/cofffilereader.cpp:1:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_ctermid.h:26:10: note: previous declaration with 'C++' linkage
   26 | char    *ctermid(char *);
      |          ^~~~~~~
[3/66] Building CXX object CMakeFiles/vcpkglib.dir/src/vcpkg/base/checks.cpp.o
FAILED: CMakeFiles/vcpkglib.dir/src/vcpkg/base/checks.cpp.o 
/usr/local/bin/g++-9  -DDISABLE_METRICS=0 -I../include -O3 -DNDEBUG -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.14   -std=c++1z -MD -MT CMakeFiles/vcpkglib.dir/src/vcpkg/base/checks.cpp.o -MF CMakeFiles/vcpkglib.dir/src/vcpkg/base/checks.cpp.o.d -o CMakeFiles/vcpkglib.dir/src/vcpkg/base/checks.cpp.o -c ../src/vcpkg/base/checks.cpp
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/wchar.h:90,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/cwchar:44,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/bits/postypes.h:40,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/bits/char_traits.h:40,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/string:40,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/stdexcept:39,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/array:39,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/tuple:39,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/functional:54,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/pstl/glue_algorithm_defs.h:13,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/algorithm:71,
                 from ../include/pch.h:22,
                 from ../src/vcpkg/base/checks.cpp:1:
/usr/local/Cellar/gcc/9.2.0/lib/gcc/9/gcc/x86_64-apple-darwin18/9.2.0/include-fixed/stdio.h:222:7: error: conflicting declaration of 'char* ctermid(char*)' with 'C' linkage
  222 | char *ctermid(char *);
      |       ^~~~~~~
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/unistd.h:525,
                 from ../include/pch.h:19,
                 from ../src/vcpkg/base/checks.cpp:1:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_ctermid.h:26:10: note: previous declaration with 'C++' linkage
   26 | char    *ctermid(char *);
      |          ^~~~~~~
[4/66] Building CXX object CMakeFiles/vcpkglib.dir/src/vcpkg/base/downloads.cpp.o
FAILED: CMakeFiles/vcpkglib.dir/src/vcpkg/base/downloads.cpp.o 
/usr/local/bin/g++-9  -DDISABLE_METRICS=0 -I../include -O3 -DNDEBUG -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.14   -std=c++1z -MD -MT CMakeFiles/vcpkglib.dir/src/vcpkg/base/downloads.cpp.o -MF CMakeFiles/vcpkglib.dir/src/vcpkg/base/downloads.cpp.o.d -o CMakeFiles/vcpkglib.dir/src/vcpkg/base/downloads.cpp.o -c ../src/vcpkg/base/downloads.cpp
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/wchar.h:90,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/cwchar:44,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/bits/postypes.h:40,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/bits/char_traits.h:40,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/string:40,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/stdexcept:39,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/array:39,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/tuple:39,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/functional:54,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/pstl/glue_algorithm_defs.h:13,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/algorithm:71,
                 from ../include/pch.h:22,
                 from ../src/vcpkg/base/downloads.cpp:1:
/usr/local/Cellar/gcc/9.2.0/lib/gcc/9/gcc/x86_64-apple-darwin18/9.2.0/include-fixed/stdio.h:222:7: error: conflicting declaration of 'char* ctermid(char*)' with 'C' linkage
  222 | char *ctermid(char *);
      |       ^~~~~~~
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/unistd.h:525,
                 from ../include/pch.h:19,
                 from ../src/vcpkg/base/downloads.cpp:1:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_ctermid.h:26:10: note: previous declaration with 'C++' linkage
   26 | char    *ctermid(char *);
      |          ^~~~~~~
[5/66] Building CXX object CMakeFiles/vcpkglib.dir/src/vcpkg/base/machinetype.cpp.o
FAILED: CMakeFiles/vcpkglib.dir/src/vcpkg/base/machinetype.cpp.o 
/usr/local/bin/g++-9  -DDISABLE_METRICS=0 -I../include -O3 -DNDEBUG -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.14   -std=c++1z -MD -MT CMakeFiles/vcpkglib.dir/src/vcpkg/base/machinetype.cpp.o -MF CMakeFiles/vcpkglib.dir/src/vcpkg/base/machinetype.cpp.o.d -o CMakeFiles/vcpkglib.dir/src/vcpkg/base/machinetype.cpp.o -c ../src/vcpkg/base/machinetype.cpp
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/wchar.h:90,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/cwchar:44,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/bits/postypes.h:40,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/bits/char_traits.h:40,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/string:40,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/stdexcept:39,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/array:39,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/tuple:39,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/functional:54,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/pstl/glue_algorithm_defs.h:13,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/algorithm:71,
                 from ../include/pch.h:22,
                 from ../src/vcpkg/base/machinetype.cpp:1:
/usr/local/Cellar/gcc/9.2.0/lib/gcc/9/gcc/x86_64-apple-darwin18/9.2.0/include-fixed/stdio.h:222:7: error: conflicting declaration of 'char* ctermid(char*)' with 'C' linkage
  222 | char *ctermid(char *);
      |       ^~~~~~~
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/unistd.h:525,
                 from ../include/pch.h:19,
                 from ../src/vcpkg/base/machinetype.cpp:1:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_ctermid.h:26:10: note: previous declaration with 'C++' linkage
   26 | char    *ctermid(char *);
      |          ^~~~~~~
[6/66] Building CXX object CMakeFiles/vcpkglib.dir/src/vcpkg/base/chrono.cpp.o
FAILED: CMakeFiles/vcpkglib.dir/src/vcpkg/base/chrono.cpp.o 
/usr/local/bin/g++-9  -DDISABLE_METRICS=0 -I../include -O3 -DNDEBUG -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.14   -std=c++1z -MD -MT CMakeFiles/vcpkglib.dir/src/vcpkg/base/chrono.cpp.o -MF CMakeFiles/vcpkglib.dir/src/vcpkg/base/chrono.cpp.o.d -o CMakeFiles/vcpkglib.dir/src/vcpkg/base/chrono.cpp.o -c ../src/vcpkg/base/chrono.cpp
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/wchar.h:90,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/cwchar:44,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/bits/postypes.h:40,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/bits/char_traits.h:40,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/string:40,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/stdexcept:39,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/array:39,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/tuple:39,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/functional:54,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/pstl/glue_algorithm_defs.h:13,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/algorithm:71,
                 from ../include/pch.h:22,
                 from ../src/vcpkg/base/chrono.cpp:1:
/usr/local/Cellar/gcc/9.2.0/lib/gcc/9/gcc/x86_64-apple-darwin18/9.2.0/include-fixed/stdio.h:222:7: error: conflicting declaration of 'char* ctermid(char*)' with 'C' linkage
  222 | char *ctermid(char *);
      |       ^~~~~~~
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/unistd.h:525,
                 from ../include/pch.h:19,
                 from ../src/vcpkg/base/chrono.cpp:1:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_ctermid.h:26:10: note: previous declaration with 'C++' linkage
   26 | char    *ctermid(char *);
      |          ^~~~~~~
[7/66] Building CXX object CMakeFiles/vcpkglib.dir/src/vcpkg/base/system.print.cpp.o
FAILED: CMakeFiles/vcpkglib.dir/src/vcpkg/base/system.print.cpp.o 
/usr/local/bin/g++-9  -DDISABLE_METRICS=0 -I../include -O3 -DNDEBUG -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.14   -std=c++1z -MD -MT CMakeFiles/vcpkglib.dir/src/vcpkg/base/system.print.cpp.o -MF CMakeFiles/vcpkglib.dir/src/vcpkg/base/system.print.cpp.o.d -o CMakeFiles/vcpkglib.dir/src/vcpkg/base/system.print.cpp.o -c ../src/vcpkg/base/system.print.cpp
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/wchar.h:90,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/cwchar:44,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/bits/postypes.h:40,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/bits/char_traits.h:40,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/string:40,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/stdexcept:39,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/array:39,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/tuple:39,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/functional:54,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/pstl/glue_algorithm_defs.h:13,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/algorithm:71,
                 from ../include/pch.h:22,
                 from ../src/vcpkg/base/system.print.cpp:1:
/usr/local/Cellar/gcc/9.2.0/lib/gcc/9/gcc/x86_64-apple-darwin18/9.2.0/include-fixed/stdio.h:222:7: error: conflicting declaration of 'char* ctermid(char*)' with 'C' linkage
  222 | char *ctermid(char *);
      |       ^~~~~~~
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/unistd.h:525,
                 from ../include/pch.h:19,
                 from ../src/vcpkg/base/system.print.cpp:1:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_ctermid.h:26:10: note: previous declaration with 'C++' linkage
   26 | char    *ctermid(char *);
      |          ^~~~~~~
[8/66] Building CXX object CMakeFiles/vcpkglib.dir/src/vcpkg/base/stringview.cpp.o
FAILED: CMakeFiles/vcpkglib.dir/src/vcpkg/base/stringview.cpp.o 
/usr/local/bin/g++-9  -DDISABLE_METRICS=0 -I../include -O3 -DNDEBUG -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.14   -std=c++1z -MD -MT CMakeFiles/vcpkglib.dir/src/vcpkg/base/stringview.cpp.o -MF CMakeFiles/vcpkglib.dir/src/vcpkg/base/stringview.cpp.o.d -o CMakeFiles/vcpkglib.dir/src/vcpkg/base/stringview.cpp.o -c ../src/vcpkg/base/stringview.cpp
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/wchar.h:90,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/cwchar:44,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/bits/postypes.h:40,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/bits/char_traits.h:40,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/string:40,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/stdexcept:39,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/array:39,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/tuple:39,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/functional:54,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/pstl/glue_algorithm_defs.h:13,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/algorithm:71,
                 from ../include/pch.h:22,
                 from ../src/vcpkg/base/stringview.cpp:1:
/usr/local/Cellar/gcc/9.2.0/lib/gcc/9/gcc/x86_64-apple-darwin18/9.2.0/include-fixed/stdio.h:222:7: error: conflicting declaration of 'char* ctermid(char*)' with 'C' linkage
  222 | char *ctermid(char *);
      |       ^~~~~~~
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/unistd.h:525,
                 from ../include/pch.h:19,
                 from ../src/vcpkg/base/stringview.cpp:1:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_ctermid.h:26:10: note: previous declaration with 'C++' linkage
   26 | char    *ctermid(char *);
      |          ^~~~~~~
[9/66] Building CXX object CMakeFiles/vcpkglib.dir/src/vcpkg/base/strings.cpp.o
FAILED: CMakeFiles/vcpkglib.dir/src/vcpkg/base/strings.cpp.o 
/usr/local/bin/g++-9  -DDISABLE_METRICS=0 -I../include -O3 -DNDEBUG -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.14   -std=c++1z -MD -MT CMakeFiles/vcpkglib.dir/src/vcpkg/base/strings.cpp.o -MF CMakeFiles/vcpkglib.dir/src/vcpkg/base/strings.cpp.o.d -o CMakeFiles/vcpkglib.dir/src/vcpkg/base/strings.cpp.o -c ../src/vcpkg/base/strings.cpp
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/wchar.h:90,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/cwchar:44,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/bits/postypes.h:40,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/bits/char_traits.h:40,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/string:40,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/stdexcept:39,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/array:39,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/tuple:39,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/functional:54,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/pstl/glue_algorithm_defs.h:13,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/algorithm:71,
                 from ../include/pch.h:22,
                 from ../src/vcpkg/base/strings.cpp:1:
/usr/local/Cellar/gcc/9.2.0/lib/gcc/9/gcc/x86_64-apple-darwin18/9.2.0/include-fixed/stdio.h:222:7: error: conflicting declaration of 'char* ctermid(char*)' with 'C' linkage
  222 | char *ctermid(char *);
      |       ^~~~~~~
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/unistd.h:525,
                 from ../include/pch.h:19,
                 from ../src/vcpkg/base/strings.cpp:1:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_ctermid.h:26:10: note: previous declaration with 'C++' linkage
   26 | char    *ctermid(char *);
      |          ^~~~~~~
[10/66] Building CXX object CMakeFiles/vcpkglib.dir/src/vcpkg/base/hash.cpp.o
FAILED: CMakeFiles/vcpkglib.dir/src/vcpkg/base/hash.cpp.o 
/usr/local/bin/g++-9  -DDISABLE_METRICS=0 -I../include -O3 -DNDEBUG -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.14   -std=c++1z -MD -MT CMakeFiles/vcpkglib.dir/src/vcpkg/base/hash.cpp.o -MF CMakeFiles/vcpkglib.dir/src/vcpkg/base/hash.cpp.o.d -o CMakeFiles/vcpkglib.dir/src/vcpkg/base/hash.cpp.o -c ../src/vcpkg/base/hash.cpp
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/wchar.h:90,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/cwchar:44,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/bits/postypes.h:40,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/bits/char_traits.h:40,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/string:40,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/stdexcept:39,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/array:39,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/tuple:39,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/functional:54,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/pstl/glue_algorithm_defs.h:13,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/algorithm:71,
                 from ../include/pch.h:22,
                 from ../src/vcpkg/base/hash.cpp:1:
/usr/local/Cellar/gcc/9.2.0/lib/gcc/9/gcc/x86_64-apple-darwin18/9.2.0/include-fixed/stdio.h:222:7: error: conflicting declaration of 'char* ctermid(char*)' with 'C' linkage
  222 | char *ctermid(char *);
      |       ^~~~~~~
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/unistd.h:525,
                 from ../include/pch.h:19,
                 from ../src/vcpkg/base/hash.cpp:1:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_ctermid.h:26:10: note: previous declaration with 'C++' linkage
   26 | char    *ctermid(char *);
      |          ^~~~~~~
[11/66] Building CXX object CMakeFiles/vcpkglib.dir/src/vcpkg/base/system.cpp.o
FAILED: CMakeFiles/vcpkglib.dir/src/vcpkg/base/system.cpp.o 
/usr/local/bin/g++-9  -DDISABLE_METRICS=0 -I../include -O3 -DNDEBUG -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.14   -std=c++1z -MD -MT CMakeFiles/vcpkglib.dir/src/vcpkg/base/system.cpp.o -MF CMakeFiles/vcpkglib.dir/src/vcpkg/base/system.cpp.o.d -o CMakeFiles/vcpkglib.dir/src/vcpkg/base/system.cpp.o -c ../src/vcpkg/base/system.cpp
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/wchar.h:90,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/cwchar:44,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/bits/postypes.h:40,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/bits/char_traits.h:40,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/string:40,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/stdexcept:39,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/array:39,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/tuple:39,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/functional:54,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/pstl/glue_algorithm_defs.h:13,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/algorithm:71,
                 from ../include/pch.h:22,
                 from ../src/vcpkg/base/system.cpp:1:
/usr/local/Cellar/gcc/9.2.0/lib/gcc/9/gcc/x86_64-apple-darwin18/9.2.0/include-fixed/stdio.h:222:7: error: conflicting declaration of 'char* ctermid(char*)' with 'C' linkage
  222 | char *ctermid(char *);
      |       ^~~~~~~
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/unistd.h:525,
                 from ../include/pch.h:19,
                 from ../src/vcpkg/base/system.cpp:1:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_ctermid.h:26:10: note: previous declaration with 'C++' linkage
   26 | char    *ctermid(char *);
      |          ^~~~~~~
[12/66] Building CXX object CMakeFiles/vcpkg.dir/src/vcpkg.cpp.o
FAILED: CMakeFiles/vcpkg.dir/src/vcpkg.cpp.o 
/usr/local/bin/g++-9  -DDISABLE_METRICS=0 -I../include -O3 -DNDEBUG -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.14   -std=c++1z -MD -MT CMakeFiles/vcpkg.dir/src/vcpkg.cpp.o -MF CMakeFiles/vcpkg.dir/src/vcpkg.cpp.o.d -o CMakeFiles/vcpkg.dir/src/vcpkg.cpp.o -c ../src/vcpkg.cpp
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/wchar.h:90,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/cwchar:44,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/bits/postypes.h:40,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/bits/char_traits.h:40,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/string:40,
                 from ../include/vcpkg/base/cstringview.h:4,
                 from ../include/vcpkg/base/chrono.h:3,
                 from ../src/vcpkg.cpp:23:
/usr/local/Cellar/gcc/9.2.0/lib/gcc/9/gcc/x86_64-apple-darwin18/9.2.0/include-fixed/stdio.h:222:7: error: conflicting declaration of 'char* ctermid(char*)' with 'C' linkage
  222 | char *ctermid(char *);
      |       ^~~~~~~
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/unistd.h:525,
                 from ../src/vcpkg.cpp:20:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_ctermid.h:26:10: note: previous declaration with 'C++' linkage
   26 | char    *ctermid(char *);
      |          ^~~~~~~
[13/66] Building CXX object CMakeFiles/vcpkglib.dir/src/vcpkg/archives.cpp.o
FAILED: CMakeFiles/vcpkglib.dir/src/vcpkg/archives.cpp.o 
/usr/local/bin/g++-9  -DDISABLE_METRICS=0 -I../include -O3 -DNDEBUG -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.14   -std=c++1z -MD -MT CMakeFiles/vcpkglib.dir/src/vcpkg/archives.cpp.o -MF CMakeFiles/vcpkglib.dir/src/vcpkg/archives.cpp.o.d -o CMakeFiles/vcpkglib.dir/src/vcpkg/archives.cpp.o -c ../src/vcpkg/archives.cpp
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/wchar.h:90,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/cwchar:44,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/bits/postypes.h:40,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/bits/char_traits.h:40,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/string:40,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/stdexcept:39,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/array:39,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/tuple:39,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/functional:54,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/pstl/glue_algorithm_defs.h:13,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/algorithm:71,
                 from ../include/pch.h:22,
                 from ../src/vcpkg/archives.cpp:1:
/usr/local/Cellar/gcc/9.2.0/lib/gcc/9/gcc/x86_64-apple-darwin18/9.2.0/include-fixed/stdio.h:222:7: error: conflicting declaration of 'char* ctermid(char*)' with 'C' linkage
  222 | char *ctermid(char *);
      |       ^~~~~~~
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/unistd.h:525,
                 from ../include/pch.h:19,
                 from ../src/vcpkg/archives.cpp:1:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_ctermid.h:26:10: note: previous declaration with 'C++' linkage
   26 | char    *ctermid(char *);
      |          ^~~~~~~
[14/66] Building CXX object CMakeFiles/vcpkglib.dir/src/vcpkg/base/files.cpp.o
FAILED: CMakeFiles/vcpkglib.dir/src/vcpkg/base/files.cpp.o 
/usr/local/bin/g++-9  -DDISABLE_METRICS=0 -I../include -O3 -DNDEBUG -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.14   -std=c++1z -MD -MT CMakeFiles/vcpkglib.dir/src/vcpkg/base/files.cpp.o -MF CMakeFiles/vcpkglib.dir/src/vcpkg/base/files.cpp.o.d -o CMakeFiles/vcpkglib.dir/src/vcpkg/base/files.cpp.o -c ../src/vcpkg/base/files.cpp
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/wchar.h:90,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/cwchar:44,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/bits/postypes.h:40,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/bits/char_traits.h:40,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/string:40,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/stdexcept:39,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/array:39,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/tuple:39,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/functional:54,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/pstl/glue_algorithm_defs.h:13,
                 from /usr/local/Cellar/gcc/9.2.0/include/c++/9.2.0/algorithm:71,
                 from ../include/pch.h:22,
                 from ../src/vcpkg/base/files.cpp:1:
/usr/local/Cellar/gcc/9.2.0/lib/gcc/9/gcc/x86_64-apple-darwin18/9.2.0/include-fixed/stdio.h:222:7: error: conflicting declaration of 'char* ctermid(char*)' with 'C' linkage
  222 | char *ctermid(char *);
      |       ^~~~~~~
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/unistd.h:525,
                 from ../include/pch.h:19,
                 from ../src/vcpkg/base/files.cpp:1:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_ctermid.h:26:10: note: previous declaration with 'C++' linkage
   26 | char    *ctermid(char *);
      |          ^~~~~~~
ninja: build stopped: subcommand failed.

Any ideas?

Ok. I found the solution. You have to install the missing headers by yourself:

$ sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /

After that the Vcpkg build runs as expected:

$ ./bootstrap-vcpkg.sh 
-- The C compiler identification is AppleClang 11.0.0.11000033
-- The CXX compiler identification is GNU 9.2.0
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Check for working CXX compiler: /usr/local/bin/g++-9
-- Check for working CXX compiler: /usr/local/bin/g++-9 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE  
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/ago/src/cpp/vcpkg/toolsrc/build.rel
[0/2] Re-checking globbed directories...
[66/66] Linking CXX executable vcpkg

Ok. I found the solution. You have to install the missing headers by yourself:

$ sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /

After that the Vcpkg build runs as expected:

$ ./bootstrap-vcpkg.sh 
-- The C compiler identification is AppleClang 11.0.0.11000033
-- The CXX compiler identification is GNU 9.2.0
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Check for working CXX compiler: /usr/local/bin/g++-9
-- Check for working CXX compiler: /usr/local/bin/g++-9 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE  
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/ago/src/cpp/vcpkg/toolsrc/build.rel
[0/2] Re-checking globbed directories...
[66/66] Linking CXX executable vcpkg

I have the exact same problem too, but the directory /Library/Developer/CommandLineTools/Packages/not exists in my macOS Mojave 10.14.6 with Xcode 11 (/Library/Developer/CommandLineTools/ does exist). And I can't find the macOS_SDK_headers_for_macOS_10.14.pkg in Apple download page.
any idea?

Did you install the latest command line tools for xcode?

$ xcode-select --install

Did you install the latest command line tools for xcode?

$ xcode-select --install

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

I had these same problems. The best solution I found was to install CommandLineTools directly from the Downloads page of the Apple Developer Site and it was able to install appropriately. However while i could then proceed with the bootstrap process there were too many errors and it stopped the installation process

Just search for them on your system like this:

$ find /Library/Developer/CommandLineTools -name "*SDK_headers*"
/Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

the 10.14 sdk headers cannot be installed on catalina

I'm seeing the same problems with xcode 11.3. Seems to me that cmake is picking the CC compiler from xcode 11 and the CXX compiler from homebrew (gcc)...that almost never works. It should use AppleClang (xcode) for both by default, so I think there is something strange with compiler selection in this project perhaps?

adding --allowAppleClang to bootstrap args changes the compiler selected, but we seem to fall into a std::filesystem availability pit of dispair (getting std::filesytem to work with xcode seems to require both xcode 11 AND a few specific platforms according to https://developer.apple.com/documentation/xcode_release_notes/xcode_11_release_notes).

I'm seeing the same problems with xcode 11.3. Seems to me that cmake is picking the CC compiler from xcode 11 and the CXX compiler from homebrew (gcc)...that almost never works. It should use AppleClang (xcode) for both by default, so I think there is something strange with compiler selection in this project perhaps?

Until homebrew鈥檚 gcc is fixed, we have this problem, you are right, it鈥檚 not the best situation being dependent on another tool.
Unfortunately --allowAppleClang only works on macOS 10.15 for std::filesystem, so it is not a universal solution.
Up until few months ago, homebrew鈥檚 gcc was perfectly fine and we never had any problem...

Hi guys, does this issue still exists?

There is the ninja 1.10 blocking issue well before that. I am not testing osx 10.13/14 anymore, only 10.15, as of now

There is the ninja 1.10 blocking issue well before that. I am not testing osx 10.13/14 anymore, only 10.15, as of now

The Ninja issue should be fixed with Ninja release 1.10.1 now in PR #13562

Ninja was updated to 1.10.1.

Was this page helpful?
0 / 5 - 0 ratings