Minimal template for building Nintendo 3DS homebrew using C++ and devkitPro.
Outputs a .3dsx file ready for the Homebrew Launcher.
Important
This template was made & tested on Linux, it is specifically made to be used with Linux + VSCode (or compatible forks)
- devkitPro toolchain installed
DEVKITPROenvironment variable set
Verify:
echo $DEVKITPROExpected output:
/opt/devkitpro
./build.shOutput will be in:
build/
Files generated:
.elf→ raw executable.3dsx→ Homebrew Launcher format.smdh→ metadata (icon, title, author)
Copy the .3dsx file to your SD card:
/3ds/YourApp/YourApp.3dsx (or whatever other path you want to use)
Then launch it via the Homebrew Launcher.
.
├── CMakeLists.txt
├── build.sh
├── src/
│ └── main.cpp
├── assets/
│ └── icon.png (optional)
Edit in CMakeLists.txt:
set(APP_NAME "3DS Template")
set(APP_DESCRIPTION "My first 3DS app")
set(APP_AUTHOR "Your Name")This controls:
- Title shown on 3DS
- Description
- Author/publisher
To use a custom icon:
ICON assets/icon.png- Format: PNG
- Recommended size: 48×48
- Keep it simple (low detail)
- Avoid transparency-heavy images
- Bright, high-contrast colors work best
The 3DS uses a limited color format internally, so complex images may look bad.
Use environment variables (to avoid hardcoding):
"includePath": [
"${workspaceFolder}/**",
"${env:DEVKITPRO}/libctru/include",
"${env:DEVKITPRO}/devkitARM/arm-none-eabi/include"
]Make sure devkitPro env is loaded:
source /etc/profile.d/devkit-env.shEnsure CMake uses toolchain:
cmake .. -DCMAKE_TOOLCHAIN_FILE=$DEVKITPRO/cmake/3DS.cmakeUse freely for your projects.