Homebrew Question Need some help getting the DevKitPro compilation environment setup

OkazakiTheOtaku

no thanks, I don't want a custom title
Member
Joined
Jul 20, 2016
Messages
1,466
Reaction score
1,371
Trophies
1
Location
127.0.0.1
XP
3,174
Country
Japan
Hi,

I'm trying to get into Switch homebrew development and while I've had some success getting the bare DevKitPro environment setup, I've hit a few hitches and can't find an answer.

On a few open source projects I'm trying to compile, I receive an SDL error, as so:
#include <SDL2/SDL.h>
no such file or directory

On a base level I know that I have to find a way to get the SDL package but I'm unsure how to do that.

When trying to compile Checkpoint I get the same thing, except it is
#include <ft2build.h>
not SDL.

I have experience programming and compiling, but I usually work with Obj-C and Swift on Xcode. I've never done anything like this.

I'm trying to set up the environment in a fresh Windows 10 VM, and I have DevKitPro and whatnot already installed. Thanks for the help!
 
Hi,

I'm trying to get into Switch homebrew development and while I've had some success getting the bare DevKitPro environment setup, I've hit a few hitches and can't find an answer.

On a few open source projects I'm trying to compile, I receive an SDL error, as so:
#include <SDL2/SDL.h>
no such file or directory

On a base level I know that I have to find a way to get the SDL package but I'm unsure how to do that.

When trying to compile Checkpoint I get the same thing, except it is
#include <ft2build.h>
not SDL.

I have experience programming and compiling, but I usually work with Obj-C and Swift on Xcode. I've never done anything like this.

I'm trying to set up the environment in a fresh Windows 10 VM, and I have DevKitPro and whatnot already installed. Thanks for the help!

You need to install the switch-sdl2 packages from the devkitPro pacman.

Instructions for that are available on the DKP/Switchbrew sites. (I can't post links)
 
I followed this guide
but it just installed DevKitPro, not the others.

You still have to install the individual packages.

sudo dkp-pacman -Sl

(That's a lowercase L)

Use that to list available packages, then use:

sudo dkp-pacman -S *

* being the package from the list you want. At minimum you'll want switch-sdl2, but I'd just install them all. They aren't exactly large.
 
You still have to install the individual packages.

sudo dkp-pacman -Sl

(That's a lowercase L)

Use that to list available packages, then use:

sudo dkp-pacman -S *

* being the package from the list you want. At minimum you'll want switch-sdl2, but I'd just install them all. They aren't exactly large.
Thanks!
 
I guess devkitpro and libnx are for programming in C only?
What would I need to write stuff in C++?
 
I guess devkitpro and libnx are for programming in C only?
What would I need to write stuff in C++?
you can use c++ with SDL2. Also right now there aren't many switch homebrew libraries/library ports i know of that you can use c++ with. SDL2 seems to be the only one for now.
 
  • Like
Reactions: lordelan
you can use c++ with SDL2. Also right now there aren't many switch homebrew libraries/library ports i know of that you can use c++ with. SDL2 seems to be the only one for now.
Coming from .NET I'm still not into all of that.
SDL2 is nothing Switch/Ninty specific but a general kind of library or framework which I can use to adress things like input/output (sound, display and so on) and with devkitpro and the sdl2 pacman package it is possible to compile a SDL2 C++ program into a NRO file?
 
Coming from .NET I'm still not into all of that.
SDL2 is nothing Switch/Ninty specific but a general kind of library or framework which I can use to adress things like input/output (sound, display and so on) and with devkitpro and the sdl2 pacman package it is possible to compile a SDL2 C++ program into a NRO file?
Yeah. You better look at sources of SDL2 apps on the switch to see how you would use it. (check out postal-nx or Fireplace-NX on github, i think they are great examples)
 
  • Like
Reactions: lordelan

Site & Scene News

Popular threads in this forum