OpenRA源码编译指南
前提:Ubuntu需要翻qiang,在编译时需要下载一些包,Ubuntu需要科学上网。
编译步骤:
1.安装OpenRA需要的库文件:
可使用下面命令安装:
sudo apt install mono-devel libfreetype6 libopenal1 liblua5.1-0 libsdl2-2.0-0 xdg-utils zenity wget
2.编译:
进入OpenRA的根目录执行以下命令
sudo make all
3.启动游戏
./launch-game.sh
错误解决:
若出现以下错误:
/bin/sh: 1: msbuild: not found
Makefile:172: recipe for target 'cli-dependencies' failed
make: *** [cli-dependencies] Error 127
OpenRA github上的issue #18690可查看
解决方法为:
一、Install .NET Core SDK or .NET Core Runtime on Ubuntu
安装SDK:
sudo apt-get update; \
sudo apt-get install -y apt-transport-https && \
sudo apt-get update && \
sudo apt-get install -y dotnet-sdk-3.1
安装Runtime:
sudo apt-get update; \
sudo apt-get install -y apt-transport-https && \
sudo apt-get update && \
sudo apt-get install -y aspnetcore-runtime-3.1
二、Add the Mono repository to your system
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
sudo apt install apt-transport-https ca-certificates
echo "deb https://download.mono-project.com/repo/ubuntu stable-xenial main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
sudo apt update
接着安装mono-complete
:
sudo apt install mono-complete
参考链接: