Homebrew devkitpro for NDS on VSCode

  • Thread starter Thread starter PilaneLose
  • Start date Start date
  • Views Views 1,029
  • Replies Replies 5

PilaneLose

New Member
Newbie
Joined
Mar 1, 2026
Messages
4
Reaction score
5
Trophies
0
Age
26
XP
31
Country
Switzerland
Hello!

I've scoured many forums and haven't yet found an exact answer to my problem!

As a few other people, I have had trouble setting up devkitpro (nds) on VsCode, and using it to compile the template projects provided.

I have set up my settings.json as @Pk11 described it here:

Make sure to install the C/C++ extension, then this is what I use for its config:
JSON:
    "C_Cpp.default.includePath": [
        "${workspaceFolder}/**",
        "/opt/devkitpro/libnds/include/**",
        "/opt/devkitpro/libctru/include/**",
        "/opt/devkitpro/devkitARM/include/**",
        "/opt/devkitpro/devkitARM/arm-none-eabi/include/**"
    ],
    "C_Cpp.default.defines": [
        "ARM9"
    ],
    "C_Cpp.default.compilerPath": "/opt/devkitpro/devkitARM/bin/arm-none-eabi-gcc",
    "C_Cpp.default.intelliSenseMode": "macos-gcc-x64",

On Windows you'll probably want something more like:
JSON:
    "C_Cpp.default.includePath": [
        "${workspaceFolder}\\**",
        "C:\\devkitPro\\libnds\\include\\**",
        "C:\\devkitPro\\libctru\\include\\**",
        "C:\\devkitPro\\devkitARM\\include\\**",
        "C:\\devkitPro\\devkitARM\\arm-none-eabi\\include\\**"
    ],
    "C_Cpp.default.defines": [
        "ARM9"
    ],
    "C_Cpp.default.compilerPath": "C:\\devkitPro\\devkitARM\\bin\\arm-none-eabi-gcc",
    "C_Cpp.default.intelliSenseMode": "windows-gcc-x64",

If you open VS Code settings (command/ctrl + comma) then click the View attachment 317212 button in the top right it'll open the settings as JSON and you can paste in what I put above, and edit as needed.

Notes:
  • The libctru line isn't needed for DS development, it's for 3DS, but I do 3DS sometimes too and figure others might as well so I left it in
  • The ARM9 define helps some libnds headers be recognized correctly as they lock their content between ARM9 and ARM7 defines. The vast majority of DS code is for ARM9 so I just leave it as that typically, but if you find yourself writing ARM7 code you may want to switch it to ARM7
  • Honestly not sure what the C_Cpp.default.intelliSenseMode does, I just set it to the one that makes sense for my OS, might make more sense to use linux arm or so idk

And I use the command "make main" while in the terminal on Vscode to run the file, but it will just NOT find "nds.h", and it's driving me insane
Capture d’écran 2026-03-02 à 01.45.40.png


I also tried creating a "tasks.json" file, and adding to the "args" section the same include paths as in the settings.json file but to no avail....

I just want to code a silly little DS game, but I am not good at bash/setting up environments/understanding C compilers.....

Could anyone please help? Thank you :)
 
this was the best I was able to get visual studio code to work, but it requires keeping the gcc version up to date
JSON:
{
    "configurations": [
        {
            "name": "NDS",
            "includePath": [
                "${workspaceFolder}/**",
                "C:/devkitPro/calico/include",
                "C:/devkitPro/libnds/include",
                "C:/devkitPro/portlibs/nds/include",
                "C:/devkitPro/devkitARM/bin/../lib/gcc/arm-none-eabi/15.2.0/include",
                "C:/devkitPro/devkitARM/bin/../lib/gcc/arm-none-eabi/15.2.0/include-fixed",
                "C:/devkitPro/devkitARM/bin/../lib/gcc/arm-none-eabi/15.2.0/../../../../arm-none-eabi/include"
            ],
            "defines": [
                "ARM9",
                "__NDS__",
                "_DEFAULT_SOURCE"
            ],
            "compilerPath": "C:/devkitPro/devkitARM/bin/arm-none-eabi-gcc.exe",
            "intelliSenseMode": "linux-gcc-arm"
        }
    ],
    "version": 4
}

for arm7 code this define helps. it could be moved to a common header for large code bases.
C:
#ifdef __INTELLISENSE__
#undef ARM9
#define ARM7
#endif

#include <calico.h>
#include <nds.h>
#include <maxmod7.h>

I am able to compile using the terminal in vs code. the issue is either missing environment variables, pathing picking up other dev environments, or you dont have all of the nds dev components installed. if you can compile from the devkitpro installed version of msys2 (that could just be your solution), but that would eliminate the dev components issue.

here is a simple test you could do in the vs code terminal. this sets some environment variables for the session.
Code:
set DEVKITARM=/opt/devkitpro/devkitARM
set DEVKITPPC=/opt/devkitpro/devkitPPC
set DEVKITPRO=/opt/devkitpro
set PATH=c:\devkitPro\msys2\usr\bin;%PATH%

copy and paste that to the terminal window in vs code. then see if running make works.
Post automatically merged:

hmm .. I saw the windows path at the top and assumed ... is this on a mac? did you do all of the setup steps here https://devkitpro.org/wiki/Getting_Started#macOS
is this arm or x86? not a mac expert so my questions may not be great ...
 
Last edited by elhobbs,
Hello!

I've scoured many forums and haven't yet found an exact answer to my problem!

As a few other people, I have had trouble setting up devkitpro (nds) on VsCode, and using it to compile the template projects provided.

I have set up my settings.json as @Pk11 described it here:



And I use the command "make main" while in the terminal on Vscode to run the file, but it will just NOT find "nds.h", and it's driving me insaneView attachment 559765

I also tried creating a "tasks.json" file, and adding to the "args" section the same include paths as in the settings.json file but to no avail....

I just want to code a silly little DS game, but I am not good at bash/setting up environments/understanding C compilers.....

Could anyone please help? Thank you :)
You need to set environment variables, you can do this by turning off antivirus and then removing devkitpro with Revo uninstaller and then reinstalling it and then updating it with administrator rights, then restarting your computer and running the updater and again then restart your computer one more time, and it should 100% fix your issue, if it does not work you will have to add them to the path manually.
 
this was the best I was able to get visual studio code to work, but it requires keeping the gcc version up to date
JSON:
{
    "configurations": [
        {
            "name": "NDS",
            "includePath": [
                "${workspaceFolder}/**",
                "C:/devkitPro/calico/include",
                "C:/devkitPro/libnds/include",
                "C:/devkitPro/portlibs/nds/include",
                "C:/devkitPro/devkitARM/bin/../lib/gcc/arm-none-eabi/15.2.0/include",
                "C:/devkitPro/devkitARM/bin/../lib/gcc/arm-none-eabi/15.2.0/include-fixed",
                "C:/devkitPro/devkitARM/bin/../lib/gcc/arm-none-eabi/15.2.0/../../../../arm-none-eabi/include"
            ],
            "defines": [
                "ARM9",
                "__NDS__",
                "_DEFAULT_SOURCE"
            ],
            "compilerPath": "C:/devkitPro/devkitARM/bin/arm-none-eabi-gcc.exe",
            "intelliSenseMode": "linux-gcc-arm"
        }
    ],
    "version": 4
}

for arm7 code this define helps. it could be moved to a common header for large code bases.
C:
#ifdef __INTELLISENSE__
#undef ARM9
#define ARM7
#endif

#include <calico.h>
#include <nds.h>
#include <maxmod7.h>

I am able to compile using the terminal in vs code. the issue is either missing environment variables, pathing picking up other dev environments, or you dont have all of the nds dev components installed. if you can compile from the devkitpro installed version of msys2 (that could just be your solution), but that would eliminate the dev components issue.

here is a simple test you could do in the vs code terminal. this sets some environment variables for the session.
Code:
set DEVKITARM=/opt/devkitpro/devkitARM
set DEVKITPPC=/opt/devkitpro/devkitPPC
set DEVKITPRO=/opt/devkitpro
set PATH=c:\devkitPro\msys2\usr\bin;%PATH%

copy and paste that to the terminal window in vs code. then see if running make works.
Post automatically merged:

hmm .. I saw the windows path at the top and assumed ... is this on a mac? did you do all of the setup steps here https://devkitpro.org/wiki/Getting_Started#macOS
is this arm or x86? not a mac expert so my questions may not be great ...
Hello! Thank you for the detailed answer!

I should have started with this, but yes, I have a Macbook with an Intel chip.
I was trying to set up for ARM9 (not that I have really looked into this all too much!)

For a little update of my debugging:

Since I wrote this post, I have tried to debug in various ways, including using the "-I" command in the terminal to manually add includepaths (as I understood it), for example:

Code:
/opt/devkitpro/devkitARM/bin/arm-none-eabi-gcc main.c -I "/opt/devkitpro/libnds/include" -o main

the added path is the file in which "nds.h" is found.

which then produces the following error:

Bash:
base) Air-de-Diane-2:source pilane.lose$ /opt/devkitpro/devkitARM/bin/arm-none-eabi-gcc main.c -I "/opt/devkitpro/libnds/include" -o main
In file included from main.c:6:
/opt/devkitpro/libnds/include/nds.h:222:2: error: #error "This header file is only for NDS ARM9 or ARM7"
  222 | #error "This header file is only for NDS ARM9 or ARM7"
      |  ^~~~~
/opt/devkitpro/libnds/include/nds.h:225:10: fatal error: calico.h: No such file or directory
  225 | #include <calico.h>
      |          ^~~~~~~~~~
compilation terminated.

So "nds.h" is found but then all the header files within it are not found because they are in yet other paths. This whole process feels a bit tedious...

About the solution you suggested, I have copy pasted the code you provided in my "c_cpp_properties.json" file (adapting the paths for Mac), and run the commands you gave in the terminal (maybe I should have modified them for Mac, but they ran fine?), but it still won't make the main (or maybe I am also misunderstanding how I am supposed to make it...?)

Bash:
(base) Air-de-Diane-2:source pilane.lose$ set DEVKITARM=/opt/devkitpro/devkitARM
(base) Air-de-Diane-2:source pilane.lose$ set DEVKITPPC=/opt/devkitpro/devkitPPC
(base) Air-de-Diane-2:source pilane.lose$ set DEVKITARM=/opt/devkitpro/devkitARM
(base) Air-de-Diane-2:source pilane.lose$ make main
cc     main.c   -o main
main.c:6:10: fatal error: 'nds.h' file not found
#include <nds.h>
         ^~~~~~~
1 error generated.
make: *** [main] Error 1
(base) Air-de-Diane-2:source pilane.lose$ /opt/devkitpro/devkitARM/bin/arm-none-eabi-gcc main.c -o main
main.c:6:10: fatal error: nds.h: No such file or directory
    6 | #include <nds.h>
      |          ^~~~~~~
compilation terminated.

I have all the components installed, as I can find them manually in my files, so I think it's really just the environment variables that are an issue. I just think I need a way to tell the compiler where my header files are, but I just can't figure it out.

Sorry for the long post, I'm really a beginner in all this so I try to be thorough! and thanks for the help anyway, really appreciate it :)
 

Attachments

  • Capture d’écran 2026-03-09 à 21.15.50.png
    Capture d’écran 2026-03-09 à 21.15.50.png
    53.7 KB · Views: 23
  • Capture d’écran 2026-03-09 à 21.19.04.png
    Capture d’écran 2026-03-09 à 21.19.04.png
    39.2 KB · Views: 21
You need to set environment variables, you can do this by turning off antivirus and then removing devkitpro with Revo uninstaller and then reinstalling it and then updating it with administrator rights, then restarting your computer and running the updater and again then restart your computer one more time, and it should 100% fix your issue, if it does not work you will have to add them to the path manually.
Hello! I am not sure I understood everything in your answer, why am I supposed to uninstall devkitpro? As far as I have seen, it has been installed properly, and the files that are supposed to be found are present in its files :) It was a real hassle to install everything in the first place on this old-ish computer, so I'd rather not do it if I can find another solution

Also, I don't think I have an antivirus (which is another problem in itself I suppose), but I did update Vscode and restart my computer several times but nothing worked :( I'll try debugging some more but if it doesn't work I suppose I will uninstall and reinstall everything! :(
 
  • Like
Reactions: NitroShell
Hello! I am not sure I understood everything in your answer, why am I supposed to uninstall devkitpro? As far as I have seen, it has been installed properly, and the files that are supposed to be found are present in its files :) It was a real hassle to install everything in the first place on this old-ish computer, so I'd rather not do it if I can find another solution

Also, I don't think I have an antivirus (which is another problem in itself I suppose), but I did update Vscode and restart my computer several times but nothing worked :( I'll try debugging some more but if it doesn't work I suppose I will uninstall and reinstall everything! :(
are you the nds sample template makefile or are you trying to use use gcc directly? you should just use the nds template and run “make” to compile. there is a ton of setup in the template makefile to build stuff for the ds. a lot more than just calling gcc.
 

Site & Scene News

Popular threads in this forum