Setting Up Your Environment
Learn how to set up your development environment for the Linux C++ Backend Development Playground project.
Prerequisites
Before starting, ensure you have the following tools installed on your system:
- Git (>= 2.0)
- Docker (>= 20.0) and Docker Compose
- Node.js (>= 18.0) - only needed for documentation development
- Basic command-line familiarity
Docker Development Environment (Recommended)
The project uses Docker to provide a consistent development environment across platforms:
-
Clone the repository:
git clone https://github.com/Kingson4Wu/cpp-linux-playground.git
cd cpp-linux-playground -
Build the development Docker image:
./scripts/docker-dev.sh build -
Start the development container:
./scripts/docker-dev.sh run -
Enter the development container:
./scripts/docker-dev.sh exec
Inside the container, you'll have access to all necessary tools including g++, CMake, Ninja, and debugging utilities.
Alternative: Local Installation (Advanced)
If you prefer to work directly on your host system (Linux/macOS):
-
Install build essentials:
# Ubuntu/Debian
sudo apt update && sudo apt install build-essential
# CentOS/RHEL
sudo yum groupinstall "Development Tools"
# macOS
xcode-select --install -
Install C++ compiler and CMake:
# Ubuntu/Debian
sudo apt install g++ cmake
# CentOS/RHEL
sudo yum install gcc gcc-c++ cmake
# macOS
brew install cmake -
Install additional dependencies:
# Ubuntu/Debian
sudo apt install libboost-all-dev libssl-dev gdb lldb clang-format valgrind
Verify Installation
After setting up your environment, verify everything works by:
-
Creating a build directory:
mkdir build && cd build -
Configuring the project:
cmake .. -DCMAKE_BUILD_TYPE=Debug -
Building the project:
make -j$(nproc)
If the build completes without errors, your environment is properly set up!
Next Steps
Now that your environment is ready, continue to the Project Overview to understand the structure and progression of the learning materials.