- MSYS2
- Visual Studio Code: install C/C++ extension for VSCode
- MariaDB Server
-
Locate your MSYS2 folder at
C:\msys64, openucrt64.exe, and run the following command:pacman -S --needed mingw-w64-ucrt-x86_64-{gcc,openssl} make
- Open the project folder in Visual Studio Code.
- Press
Ctrl + Shift + Bto start the build process.
- After compiling, press
F5to run the server!
-
Enter command associated with your distribution into the terminal to install nessesary tools.
-
Navigate to the project's root directory in your terminal and run the
makecommand:make -j$(nproc)
-
Execute the compiled binary located in the
maindirectory:./main.out
Note
macOS builds are only tested on Intel (x86_64). Apple Silicon is not tested yet.
include/enet/lib/libenet_macos.a is a universal (x86_64 + arm64) archive, so it should still link on Apple Silicon.
-
Install Homebrew or MacPorts, then run the matching command. Mixing is fine: MacPorts GCC with Homebrew OpenSSL and MariaDB uses the Homebrew compile command.
Homebrew
brew install gcc make openssl@3 mariadb-connector-c
MacPorts
sudo port install gcc15 gmake openssl3 mariadb-11.4
-
Apple's SDK does not include OpenSSL headers. Pass Homebrew or MacPorts paths on the
makeline. A plainmakefails withopenssl/ssl.h: No such file or directory. Use-lenet_macos; the default-lenetis a Linux library.Homebrew
make -j$(sysctl -n hw.ncpu) \ includes="-Iinclude -Ibuild/include -I$(brew --prefix openssl@3)/include" \ libraries="-L$(brew --prefix openssl@3)/lib -L$(brew --prefix mariadb-connector-c)/lib -L./include/enet/lib -L./include/mysql/lib -lssl -lcrypto -lmariadb -lenet_macos"
MacPorts
gmake -j$(sysctl -n hw.ncpu) \ includes="-Iinclude -Ibuild/include -I/opt/local/libexec/openssl3/include" \ libraries="-L/opt/local/libexec/openssl3/lib -L/opt/local/lib/mariadb-11.4/mysql -L./include/enet/lib -L./include/mysql/lib -lssl -lcrypto -lmariadb -lenet_macos"
-
Execute the compiled binary:
./main.out
Note
To connect to your local server, you must modify your system's hosts file.
- Windows:
C:\Windows\System32\drivers\etc\hosts - Linux/macOS:
/etc/hosts
127.0.0.1 www.growtopia1.com
127.0.0.1 www.growtopia2.com
