将 GCC 从 4.8 升级到 4.9

将 GCC 从 4.8 升级到 4.9

我正在尝试在我的服务器上安装 TrinityCore。升级GCC使用时CMake我遇到了一个问题:

以下是我收到的回复:

gcc-4.9 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@sd-25884:/home/wow/TrinityCore/build# cmake ../ -DCMAKE_INSTALL_PREFIX=/home/wow/server -DCONF_DIR=/home/wow/server/etc -DTOOLS=1 -DWITH_WARNINGS=1
-- Detected 64-bit platform
-- UNIX: Using default library directory
-- UNIX: Configuring uninstall target
-- UNIX: Created uninstall target
-- UNIX: Detected compiler: /usr/bin/cc
CMake Error at cmake/compiler/gcc/settings.cmake:7 (message):
  GCC: TrinityCore requires version 4.9.0 to build but found 4.8.4
Call Stack (most recent call first):
  cmake/platform/unix/settings.cmake:29 (include)
  cmake/macros/CheckPlatform.cmake:13 (include)
  CMakeLists.txt:58 (include)


-- Configuring incomplete, errors occurred!
See also "/home/wow/TrinityCore/build/CMakeFiles/CMakeOutput.log".
root@sd-25884:/home/wow/TrinityCore/build#

答案1

CMake 使用多个变量设置默认编译器。您最感兴趣的是设置CC变量以覆盖默认 C 编译器。在您的例子中,这将是:

CC=gcc-4.9 cmake ../ -

apt-get install g++-4.9如果 TrinityCore 是用 C++ 编写的,那么您可能需要:

CXX=g++-4.9 cmake ../ -

相关内容