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,239
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
  • No one is chatting at the moment.
  • K3Nv2 @ K3Nv2:
    @Veho, where's the poll at?
  • Julie_Pilgrim @ Julie_Pilgrim:
    they're giving the internet an open text box?
    +1
  • BigOnYa @ BigOnYa:
    I never played or own any of they devices, but I like small style, but with a somewhat grip
    +1
  • Julie_Pilgrim @ Julie_Pilgrim:
    oh man, that always goes great!
  • Julie_Pilgrim @ Julie_Pilgrim:
    im sure half the responses won't be literal racial slurs or "drop table" jokes
  • Veho @ Veho:
    Look, it's China. They know what it's like when you give a poll to half a billion trolls.
    +1
  • K3Nv2 @ K3Nv2:
    How much dollar do you think it is?
  • Veho @ Veho:
    ONE MILLION DOLLA
    +1
  • Veho @ Veho:
    I know the pricing of electronics nowadays isn't "how much it actually costs" but "how much we can get away with", but putting up a poll is just cynical.
    +1
  • K3Nv2 @ K3Nv2:
    Probably $150 someone said Anbernic said around the same price as rg556
  • Julie_Pilgrim @ Julie_Pilgrim:
    you know which game i wish they would rerelease
  • Julie_Pilgrim @ Julie_Pilgrim:
    sonic unleashed
  • K3Nv2 @ K3Nv2:
    Make it a happy meal toy
  • Julie_Pilgrim @ Julie_Pilgrim:
    that game's engine is really fucking intensive so it runs like literal shit on xbox 360 and ps3
  • Veho @ Veho:
    Nah I'm getting value creep again. I look at a $50 console "but for just a few more dollars you could get XYZ" and I end up considering the Steam Deck.
  • Julie_Pilgrim @ Julie_Pilgrim:
    like the lighting in that game was genuinely so good
  • Veho @ Veho:
    Not getting dragged into that again.
  • Julie_Pilgrim @ Julie_Pilgrim:
    i dont get why they didn't port the one game that ran the worst on consoles, to pc
  • Julie_Pilgrim @ Julie_Pilgrim:
    like you port everything to pc except the one game where it would make the most sense. why. what do you gain from this
  • Julie_Pilgrim @ Julie_Pilgrim:
    is sega just personally fucking with me? are they laughing while watching me through my kinect camera as i get up to restart my xbox for the third time because the game froze again
  • K3Nv2 @ K3Nv2:
    Buy handhelds from five below better quality
  • K3Nv2 @ K3Nv2:
    Valve probably going to do another refresh of the deck this fall with rog ally like specs tbh
  • Veho @ Veho:
    A smaller form factor would be nice too.
  • K3Nv2 @ K3Nv2:
    A shield portable 2 would be nice aye Nvidia
    +1
    K3Nv2 @ K3Nv2: A shield portable 2 would be nice aye Nvidia +1