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

invalid errors when cross compiling for esp32 #931

Open
crides opened this issue Mar 14, 2023 · 0 comments
Open

invalid errors when cross compiling for esp32 #931

crides opened this issue Mar 14, 2023 · 0 comments

Comments

@crides
Copy link

crides commented Mar 14, 2023

(I tried to create a small project and reproduce but I'm not able to even get the file to index so I'll try to describe what happens in the big project)

So I have a project that cross compiles to esp32. I have a compile_commands.json generated from CMake. When I ccls, it gives weird errors depending on what configuration I try.

I always need to replace all toolchain-specific compilers (/path/to/toolchain/xtensa-esp32-elf-gcc) with normal gcc/g++ commands in compile_commands.json for things to be indexed.

If in my .ccls, I have:

%compile_commands.json
-I/home/haoqing/.arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2021r2/xtensa-esp32-elf/include
-I/home/haoqing/.arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2021r2/xtensa-esp32-elf/include/c++/8.4.0/

then ccls gives errors like:

  • no type named '_Tp_alloc_type' in 'std::_Vector_base<double, std::allocator<double>>'
  • member reference type 'std::shared_ptr<Maneuver>' is not a pointer; did you mean to use '.'?

If I replace the %compile_commands.json with %g++ (I don't know what I should expect that does), then it gives things like:

  • unknown type name 'namespace'
  • no matching function for call to 'make_shared'

I don't seem to have a problem with ccls not finding headers, cuz there are no errors on the types, and I can go to the definition of e.g. std::shared_ptr and it's in the right include directory (when I use %compile_commands.json as the first line of .ccls).

Any ideas of what can cause issues?

System information

  • ccls version (git describe --tags --long): 0.20220729-4-g8bc39595
  • clang version: 15.0.7
  • OS: Arch
  • Editor: Neovim v0.8.3
  • Language client (and version): builtin lsp
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