Standard library missing when using CMake to generate compile_commands.json #483
Unanswered
beckettloose
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Hello, I remember the MbedStudio and KeilStudio cloud has similar/same issue. Developers said the issue is directly in the clangd, and they were not able to do something with this for 3years. @multiplemonomials any suggestion? BR, Jan |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello! I'm in the process of migrating a project over from old mbed (with PlatformIO) to mbed-ce. So far things are going well, and I am able to build and flash the project just fine with ninja. I use neovim with clangd as my "IDE", which requires a
compile_commands.json
file to instruct clangd how to build the project. I used the cmake-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
option, which gets me most of the way there. Everything from mbed-os itself is detected fine now, but it would appear that some standard library functionality is still errored out. Here is a list of everything that throws an error so farcstddef
std::vector
chrono
printf()
memcpy()
strlen()
I had a similar issue before when using PlatformIO, but they have an environment variable called
COMPILATIONDB_INCLUDE_TOOLCHAIN
that fixed it. I think the culprit is that cmake is not including the mbed c library or minimal printf library when creatingcompile_commands.json
, but I'm not sure how to go about fixing it. Any help with this would be greatly appreciated.Beta Was this translation helpful? Give feedback.
All reactions