Skip to content

Tutorial: CompileNF

kytooooo edited this page Jun 7, 2021 · 21 revisions

IF YOU CAN NOT BUILD THE DEPENDENCIES THEN PLEASE RUN THE CMDS BELOW TO SET UP THE ENVIRONMENT:

  • sudo apt-get install g++
  • sudo apt-get install cmake
  • sudo apt-get install automake
  • sudo apt-get install zip unzip

Supported Compilers

  • GCC >= 7 (Tested in Ubuntu 16.04)
  • MSVC >= VS2019 (Tested in Win10)

Build and Install

FOR WINDOWS, MSVC >= 2019

  1. Git pull the source code: git clone https://github.com/ketoo/NoahGameFrame.git
  2. Run the script file named build_dep.bat where located /Dependencies ((墙内上网的同学请点击:墙内下载依赖库.bat))
  3. Build the solution, if the build failed
    • with "protoc" related issue, please execute the NFComm\NFMessageDefine\cpp.bat and try again
    • with other ".lib" can not found issues, please build again(not rebuild all))
  4. Run the binary file by _Out/rund.bat

FOR LINUX(UBUNTU, CENTOS) ---- please use administrator(or sudo) to do these:

  1. Git pull all source: git clone https://github.com/ketoo/NoahGameFrame.git
  2. Run install4cmake.sh to build NF (or run cd /Dependencies ./build_dep.sh then run buildServer.sh)
  3. Run the binary file by _Out/rund.sh

PS:

  • rebuild NF all(download and compile all dependence libraries):install4cmake.sh
  • only build NF(we don't download and compile any dependence library): buildServer.sh
  • Some machine require run script like below: bash ./install4cmake.sh bash ./buildServer.sh

Generate property system code and xml files from _Out/NFDataCfg/Excel/ :

  • GenerateConfigXML.bat or GenerateConfigXML.sh

因为使用vcpkg管理依赖库,而依赖库又全是在境外,因此,如果遇到下载依赖库困难,请”科学上网“ 来完成依赖库的下载!

如果你使用境外的云服务器但是不能编译NF,请运行一下命令(这个是针对ubuntu,其他os,运行install4cmake.sh的时候会有提示):

  • sudo apt-get install g++
  • sudo apt-get install cmake
  • sudo apt-get install automake
  • sudo apt-get install zip unzip

支持的编译器

  • GCC >= 7 (Tested in Ubuntu 16.04)
  • MSVC >= VS2019 (Tested in Win10)

编译和安装

windows用户, MSVC >= 2019

  1. Git the source code
  2. 运行脚本 墙内下载依赖库.bat
  3. Build the solution, if the build failed
    • with "protoc" related issue, please execute the NFComm\NFMessageDefine\cpp.bat and try again
    • with other ".lib" can not found issues, please build again(not rebuild all))
  4. Run the binary file by _Out/rund.bat

linux用户(UBUNTU, CENTOS) ---- 请使用超级管理员账号 administrator(or sudo) 执行如下命令:

  1. Git pull all source PS: Some machine require run script like below: bash ./install4cmake.sh
  2. Run the binary file by _Out/rund.sh

PS:

  • 墙内下载依赖库.bat 此脚本只针对大陆不方便上github的同学使用,只有windows
  • 全部重新编译NF(包含重新下载和编译依赖库):install4cmake.sh
  • 只编译NF源码(不下载依赖库也不编译依赖库): buildServer.sh
  • 一些机器的环境要求像这样运行脚本: bash ./install4cmake.sh bash ./buildServer.sh

从 _Out/NFDataCfg/Excel/ 自动产生NF property system 需要的代码以及xml文件:

  • GenerateConfigXML.bat or GenerateConfigXML.sh
Clone this wiki locally