问题描述
我下载了mapBox-gl-native的母版,安装了所需的依赖项,然后按照说明进行了操作,然后尝试使用“ cmake --build build”进行构建,但是出现了很多错误。
[ 8%] Building CXX object CMakeFiles/mbgl-core.dir/src/mbgl/layermanager/circle_layer_factory.cpp.o
In file included from /Users/imac/Work/GitHub/mapBox-gl-native/src/mbgl/layermanager/circle_layer_factory.cpp:1:
In file included from /Users/imac/Work/GitHub/mapBox-gl-native/include/mbgl/layermanager/circle_layer_factory.hpp:3:
In file included from /Users/imac/Work/GitHub/mapBox-gl-native/include/mbgl/layermanager/layer_factory.hpp:3:
In file included from /Users/imac/Work/GitHub/mapBox-gl-native/include/mbgl/style/layer.hpp:3:
In file included from /Users/imac/Work/GitHub/mapBox-gl-native/include/mbgl/style/conversion.hpp:3:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string:504:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string_view:175:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__string:57:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:642:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/utility:199:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tuple:283:5: error: static_assert Failed due to
requirement '0UL < sizeof...(_Types)' "tuple_element index out of range"
static_assert(_Ip < sizeof...(_Types),"tuple_element index out of range");
^ ~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tuple:457:43: note: in instantiation of template class
'std::__1::tuple_element<0,std::__1::__tuple_types<> >' requested here
typedef _LIBCPP_NODEBUG_TYPE typename tuple_element<_Ip,__tuple_types<_Tp...> >::type type;
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/tuple:1007:10: note: in instantiation of template class
'std::__1::tuple_element<0,std::__1::tuple<> >' requested here
typename tuple_element<_Ip,tuple<_Tp...> >::type&
^
/Users/imac/Work/GitHub/mapBox-gl-native/include/mbgl/util/indexed_tuple.hpp:38:16: note: while substituting deduced template arguments into function template 'get'
[with _Ip = 0,_Tp = <>]
return std::get<TypeIndex<I,Is...>::value,Ts...>(*this);
^
/Users/imac/Work/GitHub/mapBox-gl-native/src/mbgl/layout/circle_layout.hpp:20:59: note: in instantiation of function template specialization
'mbgl::IndexedTuple<mbgl::TypeList<mbgl::style::CircleSortKey>,mbgl::TypeList<mbgl::style::PropertyValue<float> > >::get<mbgl::style::CircleSortKey>'
requested here
const bool sortFeaturesByKey = !unevaluatedLayout.get<style::CircleSortKey>().isUndefined();
^
这是以下结果:“ gcc --version”
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 12.0.0 (clang-1200.0.32.2)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
这是以下结果:“ cmake。-B build”
-- The CXX compiler identification is AppleClang 12.0.0.12000032
-- The C compiler identification is AppleClang 12.0.0.12000032
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Configuring GL-Native with OpenGL renderer backend
-- Found OpenGL: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/OpenGL.framework
-- Found PkgConfig: /usr/local/bin/pkg-config (found version "0.29.2")
-- Checking for one of the modules 'glfw3'
-- Not building node bindings,dependencies not found. Run 'npm update'.
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/imac/Work/GitHub/mapBox-gl-native/build
注意::我有一个旧版本的mapBox环境(2019年7月),可以使用XCode完美地进行编译(在XCode内进行编译),但是一旦我安装了XCode 12,我便开始出现相同的错误
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)