DarkflameUniverse / DarkflameServer

The main repository for the Darkflame Universe Server Emulator project.
https://www.darkflameuniverse.org/
GNU Affero General Public License v3.0
654 stars 173 forks source link

DOC: Missing g++10 requirements #1625

Open leolion3 opened 4 months ago

leolion3 commented 4 months ago

Make sure you've done the following:

Location of the documentation

https://github.com/DarkflameUniverse/DarkflameServer/blob/main/README.md

Documentation problem

The documentation is missing the fact that recent server versions require a gcc version of 10 to compile, since <span> is not part of the standard library in gcc 9.

Suggested fix for documentation

Change as required:

# Install lib essential with default gcc 9
sudo apt install build-essential

# Add key to toolchain
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update

# Replace gcc/g++ 9 with 10
sudo apt install gcc-10 g++-10
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 10
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 10

# Validate
gcc --version
g++ --version
EmosewaMC commented 4 months ago

the gcc default is dependent more on the distribution you are on and less what is on build essentials. A more accurate fix would be to have the user just install gcc-10 however they need to on their platform, which for some is just gcc and for others is the more complicated steps above due to the published package being too old for that distribution.

leolion3 commented 4 months ago

the gcc default is dependent more on the distribution you are on and less what is on build essentials. A more accurate fix would be to have the user just install gcc-10 however they need to on their platform, which for some is just gcc and for others is the more complicated steps above due to the published package being too old for that distribution.

either way would be good to reference it. I updated to the latest server version and couldnt rebuild and spent an hour looking for the problem until I found a reference that the said <span> lib import is not available and another hour trying to install g++10 on my oracle VM running Ubuntu 22.04. So I thought Id just leave the entire code as a reference.

Edit: following the basic install instructions makes you end up with a gcc version of 9.x which isnt enough.