Need help with includePath in VS Code

Hi all, I’ve set up VS Code and can successfully modify and load patches to the Daisy. However, VS Code reports it is unable to open stdint.h and math.h and that I should update my includePath file (see messages pasted below).

The patches run ok on the Pod but I’d like to fix these errors unless advised otherwise.

I have two problems:

  1. I don’t know were to locate stdint.h or math.h. I’ve searched and found several different stdint.h files, some relate to the ARM install I think, but they have different contents. Can someone provide a copy of the correct files?

  2. Once I have the files I need to save them somewhere and update the includePaths file.

What I need:
a) a copy of stdint.h and math.h
b) advice on where to store them. Do I need just one copy or a copy for each patch? (edit: fixed typo for clarity)
c) help updating the includePaths file (copied below the errors).

Errors:

#include errors detected. Please update your includePath. Squiggles are disabled for this translation unit (D:\OneDrive\GitHub\DaisyExamples\pod\MusicBox\MusicBox.cpp).
cannot open source file “stdint.h” (dependency of “daisy_pod.h”)
cannot open source file “stdint.h” (dependency of “daisysp.h”)
cannot open source file “math.h”

includePath file for MusicBox patch

c_cpp_properties.json

{
“configurations”: [
{
“name”: “Win32”,
“includePath”: [
“${workspaceFolder}/",
"${workspaceFolder}/…/…/libdaisy/
”,
“${workspaceFolder}/…/…/DaisySP/**”
],
“defines”: [
“_DEBUG”,
“UNICODE”,
“_UNICODE”
],
“windowsSdkVersion”: “10.0.17763.0”,
“compilerPath”: “arm-none-eabi-g++.exe”,
“cStandard”: “c11”,
“cppStandard”: “c++17”
}
],
“version”: 4
}

Thanks and sorry for the long post.

You should not need any of those files to be stored local to the project. The standard library files are included with the compiler (arm-none-eabi-*).

It sounds like one of the following things are happening:

  1. You’re attempting to build without a tasks.json or there is another extension trying to build with something other than the Makefile.
  2. The toolchain was not installed properly (unlikely).
  3. The shell being used could be incompatible with the toolchain or Make (I use/test everything using the MINGW64-based git-bash, that can be installed via git for windows
    • Once installed, you can select “bash” in vs code as your default terminal.

If this in your tasks.json structure:

    "tasks": [
        {
            "label": "build",
            "type": "shell",
            "command": "make clean; make",
            "options": {
                "cwd": "${workspaceFolder}"
            },
            "problemMatcher": [
                "$gcc"
            ]
        }
    ]

Then you should be able to build in any of the following three ways:

  • ctrl+shift+b and then enter (shortcut for running a task name ‘build’)
  • ctrl+p and then type task build and hit enter (standard way of running tasks)
  • use the built-in terminal and run: make (platform-inspecific command line build)

Also, this should give a different error, but the paths to libdaisy/ and DaisySP in your c_cpp_properties.json have three . characters instead of two. (i.e. .../.../libdaisy instead of ../../libdaisy).

Hope that helps! Let me know how it goes :smile:

1 Like

Thanks for your help. I got Bash working from VS Code and was able to Make and upload a patch successfully!

That’s strange re the .json file. In the edit window when I type two dots without markdown formatting it renders as three dots.
Ie this is two dots with formatting: ..
vs two dots without formatting: …

1 Like

Nice! Glad you were able to get it sorted!

Oh, you’re right, it looks like the .. does auto-complete to a single … ellipsis character (probably part of the inline markdown that the forum is using.

In the future, I’d recommend enclosing any text from a file (especially code) into the ‘preformatted text’ box. It avoids issues like that and helps make it easier to read/verify.

1 Like