1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# cargo:warning=./src/osg/osg/GL:114:10: fatal error: GL/gl.h: No such file or directory
apt update
apt install -y libgl1-mesa-dev
# error: failed to run custom build command for `_3dtile v0.1.0 (/opt/3dtiles-linux_osg_370)`
# cargo:warning=In file included from ./src/shp23dtile.cpp:6:
# cargo:warning=./src/earcut.hpp: In member function 'mapbox::detail::Earcut<N>::Node* mapbox::detail::Earcut<N>::findHoleBridge(Node*, Node*)':
# cargo:warning=./src/earcut.hpp:460:23: error: 'numeric_limits' is not a member of 'std'
# cargo:warning= 460 | double qx = -std::numeric_limits<double>::infinity();
# cargo:warning= | ^~~~~~~~~~~~~~
# cargo:warning=./src/earcut.hpp:460:38: error: expected primary-expression before 'double'
# cargo:warning= 460 | double qx = -std::numeric_limits<double>::infinity();
# cargo:warning= | ^~~~~~
# cargo:warning=./src/earcut.hpp:489:26: error: 'numeric_limits' is not a member of 'std'
# cargo:warning= 489 | double tanMin = std::numeric_limits<double>::infinity();
# cargo:warning= | ^~~~~~~~~~~~~~
# cargo:warning=./src/earcut.hpp:489:41: error: expected primary-expression before 'double'
# cargo:warning= 489 | double tanMin = std::numeric_limits<double>::infinity();
# cargo:warning= | ^~~~~~##
#
# --- stderr
# error occurred: Command "c++" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "./src" "-I" "./src/osg" "-std=c++11" "-o" "/opt/3dtiles-linux_osg_370/target/release/build/_3dtile-89abe1733ae2bb5b/out/341629401c88030c-shp23dtile.o" "-c" "./src/shp23dtile.cpp" with args c++ did not execute successfully (status code exit status: 1).
# 在文件头里添加 #include <limits>
vi src/earcut.hpp
# = note: /usr/bin/ld: /opt/3dtiles-linux_osg_370/target/release/build/_3dtile-89abe1733ae2bb5b/out/lib_3dtile.a(341629401c88030c-osgb23dtile.o): in function `get_all_tree(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) [clone .localalias]':
# osgb23dtile.cpp:(.text._Z12get_all_treeRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x2b9): undefined reference to `osgDB::readNodeFiles(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&, osgDB::Options const*)'
# /usr/bin/ld: /opt/3dtiles-linux_osg_370/target/release/build/_3dtile-89abe1733ae2bb5b/out/lib_3dtile.a(341629401c88030c-osgb23dtile.o): in function `osgb2glb_buf(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, MeshInfo&)':
# osgb23dtile.cpp:(.text._Z12osgb2glb_bufNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERS4_R8MeshInfo+0x128): undefined reference to `osgDB::readNodeFiles(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&, osgDB::Options const*)'
# collect2: error: ld returned 1 exit status
# = note: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
# = note: use the `-l` flag to specify native libraries to link
# = note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#rustc-link-lib)
apt install openscenegraph
apt install libopenscenegraph-dev
|