最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

c++ - Visual Studio Intellisense incorrect macro expansion with CMake - Stack Overflow

programmeradmin2浏览0评论

I am cross-compiling a legacy C++ project using CMake and Visual Studio 2022. The code compiles (mostly), but I am struggling to get Intellisense to work correctly when compiling not for Windows. I followed this page and I am setting the CMAKE_C_COMPILER and CMAKE_CXX_COMPILER in the toolchain file. When I do that (and regenerate the cache), it appears that it it working:

< Intellisense expansion shows __VERSION__ defined as 4.9.2 >

However, the actual compiler version is not what Intellisense shows, as you can see in the build:

< Compiler message shows __VERSION__ defined as 4.6.3 >

Is there any way to figure out where VS is pulling this information from? Does anyone know why it is not getting it correctly? I am having other issues with Intellisense not finding system includes (but again, the compiler does), and I imagine that these are related.

发布评论

评论列表(0)

  1. 暂无评论