“Game”的版本间的差异

来自linux中国网wiki
跳到导航 跳到搜索
→‎ro
→‎ro
 
(未显示同一用户的6个中间版本)
第45行: 第45行:
 
=err=
 
=err=
 
<pre>
 
<pre>
/usr/bin/ld: 找不到 -lmysqlclient
 
/usr/bin/ld: 找不到 -lrogame_pb
 
collect2: 错误:ld 返回 1
 
make[2]: *** [loginserver/CMakeFiles/loginserver.dir/build.make:1793:bin/loginserver] 错误 1
 
make[1]: *** [CMakeFiles/Makefile2:595:loginserver/CMakeFiles/loginserver.dir/all] 错误 2
 
 
 
[evan@MengZhan build]$ sudo yum whatprovides libmysqlclient*
 
上次元数据过期检查:0:03:01 前,执行于 2025年05月15日 星期四 14时57分07秒。
 
mysql-libs-8.0.26-1.module_el8.4.0+915+de215114.x86_64 : The shared libraries required for MySQL clients
 
仓库        :AppStream
 
匹配来源:
 
提供    : libmysqlclient.so.21()(64bit)
 
提供    : libmysqlclient.so.21(libmysqlclient_21.0)(64bit)
 
 
 
/home/evan/roserver/gateserver/network/protocolcoder.cpp:42:对‘ZlibTool::Compress2(char const*, int, int)’未定义的引用
 
collect2: 错误:ld 返回 1
 
make[2]: *** [gateserver/CMakeFiles/gateserver.dir/build.make:1314:bin/gateserver] 错误 1
 
make[1]: *** [CMakeFiles/Makefile2:569:gateserver/CMakeFiles/gateserver.dir/all] 错误 2
 
make: *** [Makefile:91:all] 错误 2
 
[evan@MengZhan build]$ sudo dnf install mariadb-devel
 
上次元数据过期检查:0:06:45 前,执行于 2025年05月15日 星期四 15时02分43秒。
 
错误:
 
问题: 软件包 mariadb-devel-3:10.3.28-1.module_el8.3.0+757+d382997d.x86_64 需要 mariadb-connector-c-devel >= 3.1.11,但没有提供者可以被安装
 
  - 软件包 mariadb-connector-c-devel-3.1.11-2.el8_3.i686 需要 libmariadb.so.3,但没有提供者可以被安装
 
  - 软件包 mariadb-connector-c-devel-3.1.11-2.el8_3.x86_64 需要 mariadb-connector-c = 3.1.11-2.el8_3,但没有提供者可以被安装
 
  - 已安装的软件包 MariaDB-shared-10.5.19-1.el8.x86_64 取代了 mariadb-connector-c(由 mariadb-connector-c-3.1.11-2.el8_3.i686 提供)
 
  - 已安装的软件包 MariaDB-shared-10.5.19-1.el8.x86_64 取代了 mariadb-connector-c(由 mariadb-connector-c-3.1.11-2.el8_3.x86_64 提供)
 
  - 冲突的请求
 
  - 安装的软件包的问题 MariaDB-shared-10.5.19-1.el8.x86_64
 
(尝试添加 '--skip-broken' 来跳过无法安装的软件包 或 '--nobest' 来不只使用软件包的最佳候选)
 
[evan@MengZhan build]$ sudo ldconfig
 
[evan@MengZhan build]$ ldconfig -p | grep libmysqlclient
 
  
 +
[100%] Linking CXX executable ../bin/dbserver
 +
/home/evan/roserver/lib/linux/9.2.0/libprotobuf.a(common.o): In function `google::protobuf::internal::LogMessage::operator<<(google::protobuf::uint128 const&)':
 +
common.cc:(.text+0x6c7): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
 +
/home/evan/roserver/lib/linux/9.2.0/libprotobuf.a(int128.o): In function `google::protobuf::operator<<(std::ostream&, google::protobuf::uint128 const&)':
 +
int128.cc:(.text+0x6f8): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
 +
collect2: error: ld returned 1 exit status
 +
make[2]: *** [dbserver/CMakeFiles/dbserver.dir/build.make:3479: bin/dbserver] Error 1
 +
make[1]: *** [CMakeFiles/Makefile2:431: dbserver/CMakeFiles/dbserver.dir/all] Error 2
 +
make: *** [Makefile:91: all] Error 2
 +
[root@evan-NUC11PAHi5 dbserver]#
  
 
</pre>
 
</pre>
  
=cmake=
+
=怎么搞=
 
<pre>
 
<pre>
  
[evan@MengZhan build]$ cat ../CMakeLists.txt
+
换台centos7 ?
cmake_minimum_required(VERSION 3.0.2)
+
全 ro1 and then  全 ro
  
PROJECT(SERVER)
 
set(ccache_file "/usr/local/bin/ccache")
 
if (EXISTS ${ccache_file})
 
    message(STATUS "use ccache compiler ${ccache_file}")
 
    SET(CMAKE_C_COMPILER "ccache")
 
    SET(CMAKE_C_COMPILER_ARG1 " gcc")
 
    SET(CMAKE_CXX_COMPILER  "ccache")
 
    SET(CMAKE_CXX_COMPILER_ARG1 " g++")
 
endif()
 
set(CMAKE_CXX_STANDARD 11)
 
  
set (CMAKE_MODULE_PATH ${SERVER_SOURCE_DIR}/CMake)
+
</pre>
option(USE_TCMALLOC "only build gameserver" OFF)
 
 
 
CMAKE_POLICY(SET CMP0045 OLD)
 
 
 
include(cotire)
 
 
 
SET(EXECUTABLE_OUTPUT_PATH ${SERVER_BINARY_DIR}/bin)
 
SET(LIBRARY_OUTPUT_PATH ${SERVER_SOURCE_DIR}/lib)
 
 
 
MESSAGE(STATUS "Server Bin path: ${SERVER_BINARY_DIR}")
 
MESSAGE(STATUS "Exe path: ${EXECUTABLE_OUTPUT_PATH}")
 
MESSAGE(STATUS "Src path: ${SERVER_SOURCE_DIR}")
 
 
 
INCLUDE_DIRECTORIES(${SERVER_SOURCE_DIR}/common/include )
 
INCLUDE_DIRECTORIES(${SERVER_SOURCE_DIR}/common/log )
 
INCLUDE_DIRECTORIES(${SERVER_SOURCE_DIR}/common/util )
 
INCLUDE_DIRECTORIES(${SERVER_SOURCE_DIR}/common/network/netproc )
 
INCLUDE_DIRECTORIES(${SERVER_SOURCE_DIR}/protocol )
 
INCLUDE_DIRECTORIES(${SERVER_SOURCE_DIR}/thirdparty/protobuf-3.3.x/include )
 
INCLUDE_DIRECTORIES(${SERVER_SOURCE_DIR}/thirdparty )
 
INCLUDE_DIRECTORIES(${SERVER_SOURCE_DIR}/thirdparty/apollo_voice_all/include )
 
INCLUDE_DIRECTORIES(${SERVER_SOURCE_DIR}/share/table )
 
  
#默认设置编译器版本为4.8.5
 
if(NOT DEFINED GCC)
 
SET(GCC "4.8.5")
 
endif()
 
 
if(${CMAKE_BUILD_TYPE} MATCHES Release)
 
    message(STATUS "modify cmake build type to release with debug info")
 
    SET(CMAKE_BUILD_TYPE RelWithDebInfo)
 
endif()
 
 
LINK_DIRECTORIES( ${SERVER_SOURCE_DIR}/lib )
 
LINK_DIRECTORIES(${SERVER_SOURCE_DIR}/lib/linux/${GCC})
 
 
message(STATUS "set gcc lib path: ${SERVER_SOURCE_DIR}/lib/linux/${GCC}")
 
 
#ADD_SUBDIRECTORY(common)
 
ADD_SUBDIRECTORY(protocol/pb)
 
option(BUILD_GAME "only build gameserver" OFF)
 
if(BUILD_GAME)
 
    message(STATUS "Build gameserver")
 
    ADD_SUBDIRECTORY(gameserver)
 
else(BUILD_GAME)
 
ADD_SUBDIRECTORY(dbserver)
 
ADD_SUBDIRECTORY(gateserver)
 
ADD_SUBDIRECTORY(loginserver)
 
ADD_SUBDIRECTORY(idipserver)
 
#ADD_SUBDIRECTORY(gmtool)
 
ADD_SUBDIRECTORY(audioserver)
 
ADD_SUBDIRECTORY(gameserver)
 
ADD_SUBDIRECTORY(masterserver)
 
ADD_SUBDIRECTORY(controlserver)
 
#ADD_SUBDIRECTORY(centerserver)
 
#ADD_SUBDIRECTORY(routerserver)
 
#ADD_SUBDIRECTORY(worldserver)
 
ADD_SUBDIRECTORY(fmserver)
 
#ADD_SUBDIRECTORY(versionserver)
 
#ADD_SUBDIRECTORY(teamserver)
 
#ADD_SUBDIRECTORY(combinetool)
 
#ADD_SUBDIRECTORY(proxyserver)
 
ADD_SUBDIRECTORY(tradeserver)
 
ADD_SUBDIRECTORY(battleserver)
 
ADD_SUBDIRECTORY(authserver)
 
ADD_SUBDIRECTORY(payserver)
 
ADD_SUBDIRECTORY(rankserver)
 
endif()
 
 
</pre>
 
 
=ro=
 
=ro=
 
centos8  
 
centos8  
 +
 +
=jdk=
 +
https://repo.huaweicloud.com:8443/artifactory/java-local/jdk/8u151-b12/
 
==compile lib ==
 
==compile lib ==
 
<pre>
 
<pre>
第181行: 第81行:
 
lrwxrwxrwx. 1 root root 55 May 17 09:18 lib/libconfiglib.a -> ../rogamelibs/table/buildtool/Server/lib/libconfiglib.a
 
lrwxrwxrwx. 1 root root 55 May 17 09:18 lib/libconfiglib.a -> ../rogamelibs/table/buildtool/Server/lib/libconfiglib.a
 
[root@evan-NUC11PAHi5 roserver]#  
 
[root@evan-NUC11PAHi5 roserver]#  
 +
 +
 +
/home/evan/rogamelibs/table_manager/entity_table_manager.cpp: In member function 'virtual bool ROGameLibs::EntityTableManager::Init()':
 +
/home/evan/rogamelibs/table_manager/entity_table_manager.cpp:88:33: error: 'class TableLib::EntityHandBookTable::RowData' has no member named 'RelationEntityId'
 +
            if (!book_row_data->RelationEntityId().empty())
 +
                                ^~~~~~~~~~~~~~~~
 +
/home/evan/rogamelibs/table_manager/entity_table_manager.cpp:90:50: error: 'class TableLib::EntityHandBookTable::RowData' has no member named 'RelationEntityId'
 +
                for (int32_t id : book_row_data->RelationEntityId())
 +
                                                  ^~~~~~~~~~~~~~~~
 +
make[2]: *** [CMakeFiles/rogamelibs.dir/build.make:2316: CMakeFiles/rogamelibs.dir/table_manager/entity_table_manager.cpp.o] Error 1
 +
make[2]: *** Waiting for unfinished jobs....
 +
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/rogamelibs.dir/all] Error 2
 +
make: *** [Makefile:91: all] Error 2
 +
make build_linux error!
 +
[root@evan-NUC11PAHi5 buildtool]#
  
 
</pre>
 
</pre>
第187行: 第102行:
  
 
[[Ubuntu24 mysql5.7]]
 
[[Ubuntu24 mysql5.7]]
 +
 +
== trouble shooting==
 +
<pre>
 +
[  7%] Linking CXX executable ../bin/masterserver
 +
/usr/bin/ld: cannot find -loauth
 +
/usr/bin/ld: cannot find -lcrypto
 +
collect2: error: ld returned 1 exit status
 +
make[2]: *** [masterserver/CMakeFiles/masterserver.dir/build.make:12594: bin/masterserver] Error 1
 +
make[1]: *** [CMakeFiles/Makefile2:803: masterserver/CMakeFiles/masterserver.dir/all] Error 2
 +
make: *** [Makefile:91: all] Error 2
 +
[root@evan-NUC11PAHi5 masterserver]#
 +
 +
sudo dnf install liboauth-devel openssl-devel
 +
</pre>
  
 
=知道整个游戏界面各个按钮什么的对应哪里=
 
=知道整个游戏界面各个按钮什么的对应哪里=

2025年5月20日 (二) 15:35的最新版本

贪吃蛇

#pre
sudo yum install mesa-libGL-devel

yum install libudev-devel

sudo yum install gcc-c++ cmake make libX11-devel libXrandr-devel \
                 freetype-devel openal-soft-devel libjpeg-turbo-devel \
                 libvorbis-devel flac-devel

wget https://www.sfml-dev.org/files/SFML-2.5.1-sources.zip
unzip SFML-2.5.1-sources.zip
cd SFML-2.5.1

mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release
make -j$(nproc)
sudo make install

sudo sh -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/sfml.conf'
sudo ldconfig



# 安装依赖(Ubuntu示例)
sudo apt install sfml2.5-dev g++
#代码
https://github.com/evan886/snake_game.git

# 创建构建目录
mkdir build && cd build

# 生成Makefile
cmake .. -DCMAKE_BUILD_TYPE=Release

# 编译
make -j$(nproc)

# 运行
./SnakeGame

err

[100%] Linking CXX executable ../bin/dbserver
/home/evan/roserver/lib/linux/9.2.0/libprotobuf.a(common.o): In function `google::protobuf::internal::LogMessage::operator<<(google::protobuf::uint128 const&)':
common.cc:(.text+0x6c7): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
/home/evan/roserver/lib/linux/9.2.0/libprotobuf.a(int128.o): In function `google::protobuf::operator<<(std::ostream&, google::protobuf::uint128 const&)':
int128.cc:(.text+0x6f8): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
collect2: error: ld returned 1 exit status
make[2]: *** [dbserver/CMakeFiles/dbserver.dir/build.make:3479: bin/dbserver] Error 1
make[1]: *** [CMakeFiles/Makefile2:431: dbserver/CMakeFiles/dbserver.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
[root@evan-NUC11PAHi5 dbserver]#

怎么搞

换台centos7 ?
全 ro1  and then  全 ro 


ro

centos8

jdk

https://repo.huaweicloud.com:8443/artifactory/java-local/jdk/8u151-b12/

compile lib

第一个没成功 第二个成功
[root@evan-NUC11PAHi5 roserver]# ls lib/librogamelibs.a  -l 
lrwxrwxrwx. 1 root root 50 May 17 09:18 lib/librogamelibs.a -> ../rogamelibs/buildtool/Server/lib/librogamelibs.a
[root@evan-NUC11PAHi5 roserver]# ll  lib/libconfiglib.a 
lrwxrwxrwx. 1 root root 55 May 17 09:18 lib/libconfiglib.a -> ../rogamelibs/table/buildtool/Server/lib/libconfiglib.a
[root@evan-NUC11PAHi5 roserver]# 


/home/evan/rogamelibs/table_manager/entity_table_manager.cpp: In member function 'virtual bool ROGameLibs::EntityTableManager::Init()':
/home/evan/rogamelibs/table_manager/entity_table_manager.cpp:88:33: error: 'class TableLib::EntityHandBookTable::RowData' has no member named 'RelationEntityId'
             if (!book_row_data->RelationEntityId().empty())
                                 ^~~~~~~~~~~~~~~~
/home/evan/rogamelibs/table_manager/entity_table_manager.cpp:90:50: error: 'class TableLib::EntityHandBookTable::RowData' has no member named 'RelationEntityId'
                 for (int32_t id : book_row_data->RelationEntityId())
                                                  ^~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/rogamelibs.dir/build.make:2316: CMakeFiles/rogamelibs.dir/table_manager/entity_table_manager.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/rogamelibs.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
make build_linux error!
[root@evan-NUC11PAHi5 buildtool]# 


Ubuntu24 mysql5.7

trouble shooting

[  7%] Linking CXX executable ../bin/masterserver
/usr/bin/ld: cannot find -loauth
/usr/bin/ld: cannot find -lcrypto
collect2: error: ld returned 1 exit status
make[2]: *** [masterserver/CMakeFiles/masterserver.dir/build.make:12594: bin/masterserver] Error 1
make[1]: *** [CMakeFiles/Makefile2:803: masterserver/CMakeFiles/masterserver.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
[root@evan-NUC11PAHi5 masterserver]# 

sudo dnf install liboauth-devel openssl-devel

知道整个游戏界面各个按钮什么的对应哪里