Question Need some help getting the DevKitPro compilation environment setup

Discussion in 'Switch - Emulation, Homebrew & Software Projects' started by OkazakiTheOtaku, May 24, 2018.

  1. OkazakiTheOtaku
    OP

    OkazakiTheOtaku no thanks, I don't want a custom title

    Member
    9
    Jul 20, 2016
    Japan
    127.0.0.1
    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!
     
  2. XCJLongbow

    XCJLongbow Newbie

    Newcomer
    1
    May 20, 2018
    United States
    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)
     
  3. OkazakiTheOtaku
    OP

    OkazakiTheOtaku no thanks, I don't want a custom title

    Member
    9
    Jul 20, 2016
    Japan
    127.0.0.1
  4. XCJLongbow

    XCJLongbow Newbie

    Newcomer
    1
    May 20, 2018
    United States
    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.
     
    lordelan and OkazakiTheOtaku like this.
  5. OkazakiTheOtaku
    OP

    OkazakiTheOtaku no thanks, I don't want a custom title

    Member
    9
    Jul 20, 2016
    Japan
    127.0.0.1
    Thanks!
     
  6. yesimnathan

    yesimnathan Advanced Member

    Newcomer
    3
    May 11, 2018
    United States
  7. lordelan

    lordelan GBAtemp Psycho!

    Member
    12
    Jan 4, 2015
    Germany
    I guess devkitpro and libnx are for programming in C only?
    What would I need to write stuff in C++?
     
  8. ShroomKing

    ShroomKing Mr. Nice ( ͡° ͜ʖ ͡°)

    Member
    6
    Mar 3, 2017
    United States
    in bed
    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.
     
    lordelan likes this.
  9. lordelan

    lordelan GBAtemp Psycho!

    Member
    12
    Jan 4, 2015
    Germany
    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?
     
  10. ShroomKing

    ShroomKing Mr. Nice ( ͡° ͜ʖ ͡°)

    Member
    6
    Mar 3, 2017
    United States
    in bed
    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)
     
    lordelan likes this.
  11. lordelan

    lordelan GBAtemp Psycho!

    Member
    12
    Jan 4, 2015
    Germany
    Thanks for the entry point. :) Very helpful.
     
    ShroomKing likes this.
Quick Reply
Draft saved Draft deleted
Loading...