Click here to view detailed analysis and solution
Troubleshooting and Solution for SplashKit Compilation Failure on openEuler 25.09 DevStation (WSL2)
Based on the detailed information you provided, you encountered multiple installation and compilation issues while attempting to use SplashKit for C++ development in a WSL2 environment running openEuler 25.09 DevStation. Below is a comprehensive analysis and recommended solutions.
Problem Summary
-
SplashKit installation script failed (CMake cannot find dependencies)
- The installation process reported missing dependencies such as
SDL2_ttf, SDL2_image, libcurl, etc.
- Error messages clearly state:
Package 'xxx' not found.
-
apt-get command unavailable
- Running
sudo apt-get update returns sudo: apt-get: command not found.
- Cause:
apt is the package manager used by Debian/Ubuntu systems; openEuler uses dnf and yum.
-
Missing header files during compilation
- Compilation fails with:
'splashkit.h' file not found.
- Indicates that although the installation claimed success, the header file paths or library paths were not properly configured.
-
skm command not available
- Running
skm help returns Missing skm command, indicating the command is not in PATH or was not installed.
Root Cause Analysis
1. Package Management System Difference: apt is not for openEuler
- openEuler is based on RHEL/CentOS, using
dnf or yum as its package manager.
- Using
apt-get is completely incorrect and the command does not exist by default in openEuler.
Incorrect command:
sudo apt-get update && sudo apt-get upgrade
Correct command should be:
sudo dnf update
2. Different Package Names (Debian vs openEuler)
| Debian/Ubuntu Package Name |
openEuler/RHEL Equivalent |
Available? |
libsdl2-dev |
SDL2-devel |
Yes |
libsdl2-ttf-dev |
SDL2_ttf-devel |
Yes |
libsdl2-image-dev |
SDL2_image-devel |
Yes |
libsdl2-mixer-dev |
SDL2_mixer-devel |
Yes |
libsdl2-gfx-dev |
SDL2_gfx-devel |
Yes |
libcurl4-openssl-dev |
libcurl-devel |
Yes |
The installation script searches for pkg-config modules named sd12 (should be sdl2 — possible typo or bug in the script).
3. Official SplashKit Installation Script Not Adapted for Non-Debian Systems
- The official script
skm-install.sh is primarily designed for Ubuntu/Debian and macOS.
- It relies on
apt or brew, so it will likely fail or partially fail on openEuler, a RPM-based system.
- Even if binary files are downloaded, missing development libraries may prevent usage.
Solutions
Step 1: Fix Base Environment and Package Manager
# Update system
sudo dnf update -y
# Install basic development tools
sudo dnf groupinstall "Development Tools" -y
# Install CMake (ensure version meets requirements)
sudo dnf install cmake -y
# Install Git (if not already installed)
sudo dnf install git -y
Step 2: Install Required Development Dependencies
sudo dnf install \
SDL2-devel \
SDL2_ttf-devel \
SDL2_image-devel \
SDL2_mixer-devel \
SDL2_gfx-devel \
libcurl-devel \
pkgconfig \
clang \
gcc-c++ \
make \
wget \
tar \
unzip \
-y
Note: pkgconfig is the package name in openEuler. After installation, you can use pkg-config to locate libraries.
Step 3: Manually Install SplashKit (Bypass Failed Script)
Since the automated script is unreliable, manual installation is recommended.
Method 1: Download Pre-compiled SDK from GitHub (Recommended)
# Create installation directory
mkdir -p ~/splashkit
cd ~/splashkit
# Download the Linux pre-compiled version (check for aarch64/x86_64 support)
# Example: assuming the latest release includes linux-x64.zip
wget https://github.com/splashkit/splashkit-sdk/releases/latest/download/splashkit-linux-x64.zip
unzip splashkit-linux-x64.zip
# Set environment variables (add to ~/.bashrc)
echo 'export SKM_PATH="$HOME/splashkit/splashkit-linux-x64"' >> ~/.bashrc
echo 'export PATH="$PATH:$SKM_PATH/bin"' >> ~/.bashrc
echo 'export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SKM_PATH/lib"' >> ~/.bashrc
# Reload environment
source ~/.bashrc
Method 2: Build from Source (Advanced Users)
If building from source, ensure all .pc files exist in /usr/lib64/pkgconfig/ and verify with:
pkg-config --exists SDL2 && echo yes
Step 4: Verify Installation and Header Path
# Check if header file exists
ls $SKM_PATH/include/splashkit.h
# Check library files
ls $SKM_PATH/lib/libsplashkit.*
# Compile with correct flags
clang++ "TYK AFL Score.cpp" utilities.cpp -o test \
-I$SKM_PATH/include \
-L$SKM_PATH/lib \
-lSplashKit \
-Wall
Step 5: Confirm skm Command is Available
If the SDK includes the skm binary:
# Check if skm exists
ls $SKM_PATH/bin/skm
# Test it
skm version
Otherwise, the current version may not support WSL or the command was not packaged.
Recommended Alternative Solutions (for openEuler/WSL)
Option A: Use Ubuntu WSL Image (Most Compatible)
Since SplashKit is primarily designed for Ubuntu, strongly recommended to switch to Ubuntu WSL:
wsl --install -d Ubuntu
Then run the official installation command in Ubuntu — it should work seamlessly.
Option B: Use Docker to Run SplashKit Environment
Create a Dockerfile to encapsulate the dependency environment:
FROM ubuntu:22.04
RUN apt update && apt install -y wget build-essential clang
RUN wget ... # Install SplashKit
CMD ["/bin/bash"]
Reference Resources
Summary
| Issue |
Cause |
Solution |
apt-get command not found |
Using Debian command |
Switch to dnf |
Header file splashkit.h not found |
Installation path not set |
Manually set -I$SKM_PATH/include |
skm command missing |
Installation script incomplete |
Manually install SDK and configure PATH |
| CMake cannot find dependencies |
Missing -devel packages |
Install SDL2_*-devel and other development packages |
Conclusion: The official SplashKit installation script is incompatible with openEuler. Manual SDK installation and environment setup are required. For learning or development, it is strongly recommended to switch to Ubuntu WSL for full compatibility.
If further assistance is needed, please provide the output of dnf search SDL2 and echo $SKM_PATH.