Homebrew Homebrew game Libnds compiler cannot find include path with Visual Studio Code environment

Vulf

Member
OP
Newcomer
Joined
Sep 22, 2022
Messages
11
Trophies
0
Age
18
Location
Massachusetts
XP
49
Country
United States
I recently migrated a project to Visual Studio Code for ease of use (syntax highlighting, autofill, etc.) which worked fine at first, until I had to include a class header in a different class. For whatever reason in that setup specifically the project will not compile. Including the header in main.cpp has no issues. Visual Studio Code error checking does not see the path as incorrect, and the includes of the VS Code project should be used during compilation so I'm not sure what the issue would be. Does anybody know if there's some kind of quirk with the libnds compiler that would cause behavior like this? Or is my Makefile set up incorrectly to include things?

If anybody wants to take a look at my project it can be found here, if you want to try compiling it be sure to change the settings to fit your environment
 

NightScript

Well-Known Member
Member
Joined
Feb 7, 2016
Messages
951
Trophies
1
Age
20
XP
2,238
Country
United States
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
This was posted in a similar thread. I might as well bring it here
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • Morganna @ Morganna:
    By the way, is there any website you recommend to search for some roms?
  • BigOnYa @ BigOnYa:
    No you are not allowed to discuss them here, against the rules of the site. Sorry. But you can Google Nintendo NSP and there will be a few listed.
  • Morganna @ Morganna:
    @BigOnYa that was actually very helpful, thank you very much
    +1
  • BigOnYa @ BigOnYa:
    Game on!
  • K3Nv2 @ K3Nv2:
    Actually looking forward to that new m&ms song Friday
  • DTApple @ DTApple:
    Water is the Wii Startup Disc of the soul.
  • BigOnYa @ BigOnYa:
    I won't listen till they bring back the purple ones
  • K3Nv2 @ K3Nv2:
    For every Nintendo question that gets asked I'll post a Taylor swift song in return
    +1
  • BigOnYa @ BigOnYa:
    Whatever happened to D12?
  • K3Nv2 @ K3Nv2:
    Split after their friends death but still friends
    +1
  • BakerMan @ BakerMan:
    still waiting on my salsa lmao
    em you lied to us
  • BigOnYa @ BigOnYa:
    I remb that song, i just never knew that was what he was talking bout.
  • a_username_that_is_cool @ a_username_that_is_cool:
    the backwards d looks so weird
  • a_username_that_is_cool @ a_username_that_is_cool:
    like :D or D: is nowhere near as odd as ꓷ:
  • BakerMan @ BakerMan:
    (: is just the text version of 🙃 no matter how much they want me to think it's 🙂
  • K3Nv2 @ K3Nv2:
    emo
  • HiradeGirl @ HiradeGirl:
    tional
  • HiradeGirl @ HiradeGirl:
    What is a Nintendo 3DS?

    Like 3 Nintendo DS taped into one?
  • BigOnYa @ BigOnYa:
    Hey @HiradeGirl , how you been. Hope all is well.
  • Sicklyboy @ Sicklyboy:
    DDDS
    +1
  • HiradeGirl @ HiradeGirl:
    @BigOnYa Everything's going great. It's just that real life happens.
    +1
  • HiradeGirl @ HiradeGirl:
    DSDSDS?
  • realtimesave @ realtimesave:
    ohio is round on both sides and hi in the middle
    +1
  • BigOnYa @ BigOnYa:
    And real f ing high! But not the height. We got legal recreation now, so yea...
    BigOnYa @ BigOnYa: And real f ing high! But not the height. We got legal recreation now, so yea...