question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[cmakefileapi-parser] Code model version (2.1) of cmake-file-api is unexpected. Expecting (2.0). IntelliSense configuration may be incorrect.

See original GitHub issue

I am trying to build a c++ project on windows with visual studio code and cmake-tools extension.

My versions are cmake: 3.18.0-rc1 cmake tools (vscode extension): 1.4.1

When I build, I get this annoying message about codemodel version.

[cmakefileapi-parser] Code model version (2.1) of cmake-file-api is unexpected. Expecting (2.0). IntelliSense configuration may be incorrect.
[cmakefileapi-parser] Code model version (2.1) of cmake-file-api is unexpected. Expecting (2.0). IntelliSense configuration may be incorrect.

This messages appear at configuration, and also when I build.

It is the exact same problem mentionned by someone else in this stackoverflow question : https://stackoverflow.com/questions/62445673/cmakefileapi-parser-warning-message-about-cmake-in-windows-vscode

One of the comments on stackoverflow suggests to edit the file \build\.cmake\api\v1\reply\codemodel-v2-[???].json and edit the minor version at the bottom of the file from ‘1’ to ‘0’.

It does make the messages disappear for build after this changes, but as this file is generated at configuration, the warning comes back everytime you want to run cmake again…

Also I don’t know if this modification breaks anything or not.

UPDATE: when writing this issue and checking my version of cmake, I figured out I was using a release candidate (for some reason it is the first displayed on cmake website and I did not pay attention when I downloaded it). I installed the latest cmake release (3.17.3) instead, and the problem “disappeared”.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:7
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

8reactions
KyleFromKitwarecommented, Jul 1, 2020

if the code model hasn’t changed substantially in revision 2.1, the message can be safely ignored.

CMake upstream here, this is a minor update which only adds new fields to the File API output - it won’t break older clients. The warning is safe to ignore.

I’ve opened #1343 to suppress the warning for newer versions.

6reactions
bobbrowcommented, Sep 30, 2020

The remaining message will be fixed in 1.5

Read more comments on GitHub >

github_iconTop Results From Across the Web

cmakefileapi-parser warning message about CMake in ...
This warning refers to the version of the Code model used by the CMake File API. As seen in this link, CMake expects...
Read more >
CMake tools error - path to compiler - PX4 Discuss
[cmakefileapi-parser] Code model version (2.1) of cmake-file-api is unexpected. Expecting (2.0). IntelliSense configuration may be incorrect ...
Read more >
VS Code - cmake - ninja - intellisense problem - Mbed Forum
The line: “configurationProvider”: “ms-vscode.makefile-tools” looks suspicious, but I'm having some difficulty figuring out where it comes from ...
Read more >
vscode-cmake-tools/support - Gitter
but when I call "build" in Visual Studio Code, it tries to configure the project again, invalidates the CMake cache and CMake fails....
Read more >
vscode + cmake 的配置与使用(实践)02 - CSDN博客
出现问题: [cmakefileapi-parser] Code model version (2.1) of cmake-file-api is unexpected. Expecting (2.0). IntelliSense configuration may ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found