Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/search/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 在CentOS 7上从源代码构建TileServer GL_C++_Linux_Centos7_Mapbox Gl_Openmaptiles - Fatal编程技术网

C++ 在CentOS 7上从源代码构建TileServer GL

C++ 在CentOS 7上从源代码构建TileServer GL,c++,linux,centos7,mapbox-gl,openmaptiles,C++,Linux,Centos7,Mapbox Gl,Openmaptiles,我已经在Debian环境中成功地从源代码构建并运行了TileServer GL,但是这次安装的要求是它必须安装在CentOS 7上,似乎我遇到了一个无法克服的问题。不过,我并不是一位linux专家,所以我希望这里的人能够提供一些指导 下面是Dockerfile中安装节点和CentOS依赖项的部分: FROM centos:latest RUN curl --silent --location https://rpm.nodesource.com/setup_6.x | bash - RUN yu

我已经在Debian环境中成功地从源代码构建并运行了TileServer GL,但是这次安装的要求是它必须安装在CentOS 7上,似乎我遇到了一个无法克服的问题。不过,我并不是一位linux专家,所以我希望这里的人能够提供一些指导

下面是Dockerfile中安装节点和CentOS依赖项的部分:

FROM centos:latest
RUN curl --silent --location https://rpm.nodesource.com/setup_6.x | bash -
RUN yum -y install nodejs \
       cairo \
       cairo-devel \
       gcc-c++ \
       libcurl-devel \
       libgcc.x86_64 \
       libXxf86vm-devel \
       make \
       mesa-libGL-devel \
       mesa-libgbm \
       mesa-libGLES \
       protobuf-devel \
       xorg-x11-server-Xvfb
RUN rm -rf /var/cache/yum

# Symlink to libcurl-gnutls
RUN ln -s /usr/lib64/libcurl.so.4 /usr/lib64/libcurl-gnutls.so.4
当我运行docker图像时,TileServer试图启动,但随后说:

Error: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /tileserver-gl/node_modules/@mapbox/mapbox-gl-native/lib/mapbox_gl_native.node)
在CentOS 7中,GLIBCXX的版本停止在3.4.19,据我所知,没有办法改变这一点。因此,我的问题是:

1) 我不能在CentOS中更新libstdc++是真的吗

2) 如果这是真的,那么还有别的办法吗?也许我有一种方法可以构建TeleServer GL或MpBaseGL原生,在那里C++的早期版本是可接受的? 这个问题很严重,但从来没有任何解决办法。这方面的任何帮助都会非常好。

添加

RUN echo "[warning:fedora]" | tee /etc/yum.repos.d/FedoraRepo.repo && \
echo "name=fedora" | tee -a /etc/yum.repos.d/FedoraRepo.repo  && \
echo "mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-23&arch=\$basearch" | tee -a /etc/yum.repos.d/FedoraRepo.repo  && \
echo "enabled=1" | tee -a /etc/yum.repos.d/FedoraRepo.repo  && \
echo "gpgcheck=1" | tee -a /etc/yum.repos.d/FedoraRepo.repo  && \
echo "gpgkey=https://getfedora.org/static/34EC9CBA.txt" | tee -a /etc/yum.repos.d/FedoraRepo.repo  && \
yum -y update gcc g++
你的Docker形象,它应该工作。它有点粗糙,但它可以工作:)


来源:

你是救命恩人!!我喜欢你的解决方案来自rmrice,这个用户最初在Github问题线程中提出了这个问题。这太棒了,非常感谢。如果可以,我会+1000这个:)