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
  • No one is chatting at the moment.
  • S @ salazarcosplay:
    hunter x hunter
  • S @ salazarcosplay:
    he has not allowed anyone to continue it for him for example
  • Xdqwerty @ Xdqwerty:
    @salazarcosplay, theres a dragon ball af mod for budokai 3
  • Xdqwerty @ Xdqwerty:
    updated ship of harkinian, gonna install some hd texture pack
  • Xdqwerty @ Xdqwerty:
    I might download rayman revolution for my ps3
  • BigOnYa @ BigOnYa:
    I may try the new ram site, and download more RAM to my Switch. Not sure if ddr3 is the right ram
    for it tho. Edit- no it uses floppy Ram, just like @AncientBoi
    +1
  • Xdqwerty @ Xdqwerty:
    aeiou
  • BigOnYa @ BigOnYa:
    And sometimes Z
  • SylverReZ @ SylverReZ:
    @K3Nv2, MAGA supporters be wearing tin foil hats lol.
    +1
  • Xdqwerty @ Xdqwerty:
    @SylverReZ, whats maga?
  • BigOnYa @ BigOnYa:
    It stands for Maniacs Against General Acceptance
    +1
  • Xdqwerty @ Xdqwerty:
    @BigOnYa, people rejecting general consensus about stuff?
    +1
  • BigOnYa @ BigOnYa:
    Yup, nuh its really just Trump followers
  • Xdqwerty @ Xdqwerty:
    @BigOnYa, im not american so i dont care about trump
    +1
  • Xdqwerty @ Xdqwerty:
    or us elections
  • BigOnYa @ BigOnYa:
    Me niether, us north Koreans don't care
  • Xdqwerty @ Xdqwerty:
    good night
  • BakerMan @ BakerMan:
    i don't care either, even if i'm american
  • BakerMan @ BakerMan:
    truth be told, i agree with psi, i dislike both candidates, but i'd probably vote trump simply because the economy was better during his presidency
  • AngryCinnabon @ AngryCinnabon:
    Just be careful, if trump ends up winning and using project 2025 America might really change...for the worse.
  • AngryCinnabon @ AngryCinnabon:
    I'm not american and even that sends shivers down my spine.
  • AngryCinnabon @ AngryCinnabon:
    anything that offers trump an opportunity to become an actual dictator
    is bad in my book, i could care less if it wasn't for that...
  • K3Nv2 @ K3Nv2:
    Canada: America's Russia
  • NinStar @ NinStar:
    people are so dramatic that I can't even tell if they are being serious
    NinStar @ NinStar: people are so dramatic that I can't even tell if they are being serious