You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

求助:在CentOS 6.9上安装GLIBCXX_3.4.15的方法

Fixing GLIBCXX_3.4.15 Missing Error for Garry's Mod Server on CentOS 6.9

Hey, I’ve dealt with this exact problem on CentOS 6.9 before—since the system ships with GCC 4.4.7, which only supports up to GLIBCXX_3.4.13, upgrading the system-wide libstdc++ would break your existing apps. Instead, we can install a standalone version of the library just for your Garry's Mod server. Here are two reliable methods:

Method 1: Compile a Newer GCC to a Custom Directory (Most Stable)

This approach keeps the new library isolated from your system, so no risk to other applications:

  1. Install build dependencies
    First, grab the tools needed to compile GCC:

    yum install -y gcc-c++ make wget bzip2
    
  2. Download and extract GCC 4.9.4 (supports GLIBCXX_3.4.15)
    GCC 4.9.x is the minimum version that includes the GLIBCXX_3.4.15 symbol we need:

    cd /usr/local/src
    wget https://ftp.gnu.org/gnu/gcc/gcc-4.9.4/gcc-4.9.4.tar.bz2
    tar -xjvf gcc-4.9.4.tar.bz2
    cd gcc-4.9.4
    
  3. Fetch required prerequisites
    Use GCC's built-in script to download dependencies like MPFR, GMP, and MPC:

    ./contrib/download_prerequisites
    
  4. Configure and compile GCC
    We’ll install it to /usr/local/gcc-4.9.4 to avoid overwriting system files:

    mkdir build
    cd build
    ../configure --prefix=/usr/local/gcc-4.9.4 --disable-multilib
    make -j$(nproc)  # Uses all CPU cores to speed up compilation (this takes time!)
    make install
    
  5. Point Garry's Mod to the new library
    Before starting the server, tell it to use our custom libstdc++ first:

    export LD_LIBRARY_PATH=/usr/local/gcc-4.9.4/lib64:$LD_LIBRARY_PATH
    ./srcds_run [your server launch arguments]
    

    To make this permanent, add the export line to your server’s startup script.

Method 2: Copy a Standalone libstdc++.so.6 to Your Server Directory

If compiling feels too heavy, you can copy the required library file directly to your Garry's Mod bin folder:

  1. Get the libstdc++.so.6 file
    If you used Method 1, copy it from your custom GCC install:

    cp /usr/local/gcc-4.9.4/lib64/libstdc++.so.6 /path/to/your/garrysmod/bin/
    

    Alternatively, you can copy it from another CentOS 6 system that has the library installed (same architecture).

  2. Launch the server with the local library
    Start the server while forcing it to use the library in the bin folder:

    LD_LIBRARY_PATH=./bin:$LD_LIBRARY_PATH ./srcds_run [your server launch arguments]
    

Verify the Fix

To confirm the new library includes GLIBCXX_3.4.15, run:

strings /usr/local/gcc-4.9.4/lib64/libstdc++.so.6 | grep GLIBCXX_3.4.15

If you see GLIBCXX_3.4.15 in the output, you’re good to go.


内容的提问来源于stack exchange,提问作者Matt

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.27 09:21:49