A comprehensive, containerized C++ development environment designed for serious C++ development with modern toolchains, package managers, and debugging tools.
- GCC 12 - Latest stable GNU Compiler Collection
- Clang 15 - Modern LLVM-based compiler with advanced diagnostics
- C++20 Support - Full support for the latest C++ standard
- Multiple Standards - C++11, C++14, C++17, C++20 support
- CMake 3.16+ - Modern build system generator
- Ninja - Fast, parallel build system
- Make - Traditional build system
- Autotools - Configure, make, install workflow
- vcpkg - Microsoft's C++ package manager
- Conan 2.0 - Modern C++ package manager
- System Packages - Pre-installed development libraries
- GDB - GNU Debugger with container debugging support
- Valgrind - Memory debugging and profiling suite
- AddressSanitizer (ASan) - Fast memory error detector
- ThreadSanitizer (TSan) - Data race detector
- Strace/Ltrace - System and library call tracers
- Clang-Tidy - Clang-based C++ linter
- Clang-Format - Code formatter
- CppCheck - Static analysis tool
- Vera++ - Source code analyzer
- Google Test (GTest) - Unit testing framework
- Google Mock (GMock) - Mocking framework
- CTest - CMake integrated testing
- VS Code Extensions - Full C++ development suite
- Git & Git LFS - Version control
- Doxygen - Documentation generation
- Python 3 - Scripting and tool support
cppBench/
βββ .devcontainer/ # Development container configuration
β βββ Dockerfile # Container definition with all tools
β βββ devcontainer.json # VS Code devcontainer settings
β βββ docker-compose.yml # Multi-container orchestration
β βββ post-create.sh # Post-creation setup script
β βββ BUILD_FIXES.md # Troubleshooting guide
β βββ .env # Environment variables
β βββ .env.example # Environment template
βββ launch-devbench.sh # Quick VS Code launcher (Linux/macOS)
βββ start-monster.ps1 # PowerShell launcher (Windows)
βββ start-monster.sh # Advanced shell launcher
βββ .gitignore # Comprehensive C++ gitignore
βββ README.md # This file
- Docker Desktop - For containerization
- VS Code - With Dev Containers extension (recommended)
- Git - For version control
# Clone and launch
git clone <your-repo-url>
cd cppBench
./launch-devbench.sh# Launch with direct shell access
./start-monster.sh --shell
# Or rebuild and launch
./start-monster.sh --rebuild --shell# Launch from PowerShell
.\start-monster.ps1
# Rebuild and launch
.\start-monster.ps1 -Rebuild- Container Build - First launch will build the container (~10-15 minutes)
- VS Code Integration - Extensions will install automatically
- Sample Project - Ready-to-use C++20 sample project included
- Environment Setup - All tools pre-configured and ready
A complete sample project is included to demonstrate the environment:
# Navigate to sample project
cd /workspace/projects/sample-cpp
# Build and test
./build.sh
# Run the application
../builds/sample-cpp/sample_app
# Run tests
../builds/sample-cpp/sample_tests- Modern C++20 syntax and features
- CMake build system with multiple targets
- Google Test unit tests
- Clang-Format configuration
- Header/source separation
- Namespace organization
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug
cmake --build . --parallel $(nproc)mkdir build && cd build
cmake .. -GNinja -DCMAKE_BUILD_TYPE=Debug
ninja# With CTest
ctest --output-on-failure
# Direct execution
./your_test_executablegdb ./your_test_executable
(gdb) run# Search for packages
vcpkg search boost
# Install packages
vcpkg install boost-system boost-filesystem
# In CMakeLists.txt
find_package(Boost REQUIRED COMPONENTS system filesystem)# Create conanfile.txt
[requires]
boost/1.82.0
[generators]
CMakeDeps
# Install dependencies
conan install . --build=missinggdb ./your_program
(gdb) set args arg1 arg2
(gdb) break main
(gdb) run# Memory check
valgrind --tool=memcheck --leak-check=full ./your_program
# Performance profiling
valgrind --tool=callgrind ./your_program# Compile with ASan
cmake .. -DCMAKE_CXX_FLAGS="-fsanitize=address -g"
./your_program# Generate compile_commands.json
cmake .. -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
# Run analysis
clang-tidy src/*.cppcppcheck --enable=all --std=c++20 src/# Switch to Clang
export CC=clang-15
export CXX=clang++-15
cmake .. -DCMAKE_BUILD_TYPE=Debug
# Switch back to GCC
export CC=gcc-12
export CXX=g++-12The environment supports development for multiple platforms with consistent tooling across Linux, macOS, and Windows hosts.
- Link Time Optimization (LTO)
- Profile Guided Optimization (PGO)
- Parallel compilation with optimal core usage
- Ninja generator for fastest builds
- Container build fails: Check Docker resources and network connectivity
- VS Code connection issues: Rebuild container or restart VS Code
- Compilation errors: See
.devcontainer/BUILD_FIXES.md - Permission issues: Container runs as
vscodeuser with sudo access
# Check compiler versions
gcc --version
clang --version
# Check CMake version
cmake --version
# Check available tools
which gdb valgrind clang-tidy cppcheck
# Check environment
echo $CC $CXX
printenv | grep -E "(VCPKG|CONAN)"- BUILD_FIXES.md - Comprehensive troubleshooting guide
- Container logs - Check Docker logs for container issues
- VS Code Dev Containers - Extension documentation
- Tool documentation - Each tool has extensive online docs
- Parallel compilation utilizing all available cores
- Ninja generator for optimal build dependency tracking
- ccache integration for incremental builds (optional)
- Precompiled headers support
- Base Image: Ubuntu 22.04 LTS
- Container Size: ~4-6 GB (includes all tools)
- Memory Usage: 2-8 GB depending on workload
- CPU Usage: Optimized for multi-core development
- GCC 12.x (default)
- Clang 15.x with LLVM tools
- Support for C++11 through C++20
- Boost libraries
- OpenSSL development headers
- cURL development libraries
- Eigen3 mathematical library
- Google Test and Google Mock
- Git with LFS support
- CMake 3.16+
- Ninja build system
- pkg-config
- Autotools suite
- Python 3 with pip
- VS Code optimized settings
- IntelliSense configuration
- Debugging configurations
- Code formatting rules
- Extension recommendations
- Non-root user execution (vscode user)
- Sudo access for system administration when needed
- Container isolation from host system
- Secure defaults for all development tools
This development environment is designed to be extensible. To add new tools or modify configurations:
- Dockerfile - Add system packages and tools
- devcontainer.json - VS Code settings and extensions
- post-create.sh - Additional setup steps
- BUILD_FIXES.md - Document new troubleshooting steps
This development environment configuration is provided as-is for development use.
Ready for heavy C++ development! π οΈβ‘π