Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot see symbols in namespace std with arm-none-eabi. #970

Open
ljoseph01 opened this issue Sep 12, 2024 · 0 comments
Open

Cannot see symbols in namespace std with arm-none-eabi. #970

ljoseph01 opened this issue Sep 12, 2024 · 0 comments

Comments

@ljoseph01
Copy link

I am compiling for ARM embedded with arm-none-eabi using coc.nvim with Vim 9.1.

Trying to use std::array gives me the error no template named 'array' in namespace 'std' (ccls 2). I have included the correct header file before the usage and using COC's go to definition takes me to the correct version i.e. the arm-none-eabi file.

My COC setup is as follows:

{
  "inlayHint.enable": false,
  "workspace.rootPatterns": [
      ".cocws"
  ],
  "workspace.workspaceFolderCheckCwd": true,
  "workspace.bottomUpFiletypes": [
      "*.cpp",
      "*.h"
  ],
  "languageserver": {
      "ccls": {
          "command": "ccls",
          "filetypes": ["c", "cpp", "h", "hpp"],
          "rootPatterns": [".cocws", "compile_commands.json", ".vim"],
          "initializationOptions": {
              "cache": {
                  "directory": ".ccls-cache"
              },
              "client": {
                  "snippetSupport": true
              },
              "clang": {
                  "extraArgs": [
                      "--gcc-toolchain=/opt/gcc-arm-none-eabi-10.3-2021.10/",
                      "-isystem/opt/gcc-arm-none-eabi-10.3-2021.10/arm-none-eabi/include",
                      "-isystem/opt/gcc-arm-none-eabi-10.3-2021.10/arm-none-eabi/include/c++/10.3.1"
                  ]
              }
          }
      }
  }
}

As you can see, I have provided the correct compiler path with --gcc-toolchain and -isystem. This is how I got COC to find the correct header file. The header file itself clearly defines the templated array struct. Importantly, this code does compile correctly and I am using the compile commands generated with bear make. The problem is only with the language server.

It is possible that this is an error on my part. Perhaps there is a command line option in the compile commands which is not supported by clang. Any help would be greatly appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant