Platform Support
S2D CLI supports Windows, Linux, and macOS with different levels of automation for each platform.
🔗 Overview
S2D CLI automatically detects your operating system and configures projects accordingly. However, the level of automation varies significantly between platforms:
Platform | Library Setup | Native Libraries | Build Configuration |
---|---|---|---|
Windows | ✅ Automatic | ✅ DLLs copied | ✅ Full paths configured |
Linux | ⚠️ Manual required | ⚠️ System install needed | ⚠️ Manual configuration |
macOS | ⚠️ Manual required | ⚠️ Homebrew install needed | ⚠️ Manual configuration |
🔗 Windows
Windows has the best support with full automation. S2D CLI will:
Automatic Setup
- Download SDL2, GLEW, and STB libraries automatically
- Copy required DLLs (
SDL2.dll
,glew32.dll
) to project root - Configure build files with correct library and include paths
- Set up linking options for Windows-specific libraries
Generated Configuration
The build configuration includes:
// SBT example
nativeConfig ~= { c =>
c.withLinkingOptions(c.linkingOptions ++ Seq(
"-LC:\\path\\to\\project\\libraries\\SDL2\\lib",
"-LC:\\path\\to\\project\\libraries\\glew\\lib\\Release\\x64",
"-LC:\\path\\to\\project\\libraries\\STB",
"-lSDL2", "-lSDL2main", "-lglew32", "-lopengl32", "-lglu32"
))
}
Project Structure (Windows)
my-s2d-project/
├── SDL2.dll # Copied automatically
├── glew32.dll # Copied automatically
├── libraries/
│ ├── SDL2/
│ │ ├── lib/ # Windows libraries
│ │ └── include/ # Headers
│ ├── glew/
│ │ ├── lib/Release/x64/ # Windows libraries
│ │ └── include/ # Headers
│ └── STB/
│ └── include/ # Headers
└── main.scala
🔗 Linux
Linux requires manual setup of native libraries. S2D CLI will generate a project with commented configuration that you need to enable after installing dependencies.
Required Dependencies
Install development packages for SDL2, GLEW, and STB:
Ubuntu/Debian
sudo apt-get update
sudo apt-get install libsdl2-dev libglew-dev libstb-dev
Fedora/RHEL
sudo dnf install SDL2-devel glew-devel stb-devel
Arch Linux
sudo pacman -S sdl2 glew stb
Manual Configuration
After installing dependencies, uncomment and adjust the build configuration:
// Uncomment and adjust paths as needed
nativeConfig ~= { c =>
c.withLinkingOptions(c.linkingOptions ++ Seq(
"-lSDL2", "-lSDL2main", "-lGLEW", "-lGL"
))
}
Warning Message
When generating projects on Linux, you'll see:
WARNING: Generated project requires manual configuration on non-Windows systems
- Install SDL2, GLEW, and STB development libraries for your platform
- Update the native linking paths in your build configuration
- For Ubuntu/Debian: sudo apt-get install libsdl2-dev libglew-dev
🔗 macOS
macOS requires manual setup using Homebrew or MacPorts.
Required Dependencies
Using Homebrew (Recommended)
brew install sdl2 glew
Using MacPorts
sudo port install libsdl2 glew
Manual Configuration
After installing dependencies, uncomment and adjust the build configuration:
// Uncomment and adjust for macOS
nativeConfig ~= { c =>
c.withLinkingOptions(c.linkingOptions ++ Seq(
"-lSDL2", "-lSDL2main", "-lGLEW",
"-framework OpenGL" // macOS-specific
))
}
Framework Linking
macOS uses frameworks instead of traditional libraries for OpenGL:
- Use
-framework OpenGL
instead of-lGL
- Ensure Xcode Command Line Tools are installed
- May need to specify additional framework search paths
🔗 Troubleshooting
Common Issues
Library Not Found Errors
If you see linking errors like "library not found":
- Windows: Ensure DLLs are in project root or system PATH
- Linux: Install dev packages and update build configuration
- macOS: Install via Homebrew and verify framework paths
Header File Errors
If compilation fails with missing headers:
- Ensure development packages are installed (not just runtime libraries)
- Verify include paths in build configuration
- Check that libraries are installed system-wide
Runtime Errors
If the compiled program fails to start:
- Windows: Ensure DLLs are accessible
- Linux/macOS: Check
LD_LIBRARY_PATH
or useldd
/otool
to verify dependencies
Getting Help
If you encounter platform-specific issues:
- Check the GitHub Issues
- Verify your platform's development environment is complete
- Test with a minimal SDL2 example outside of S2D