简体   繁体   English

Qt Creator Clang Code Model can't find included header in included header

[英]Qt Creator Clang Code Model can't find included header in included header

My problem is as follow: The clang code model from Qt Creator is unable to find the first header included in the header file of a cpp file. My problem is as follow: The clang code model from Qt Creator is unable to find the first header included in the header file of a cpp file.

CPP-File: CPP 文件:

.cpp 文件

Header file of that cpp-file:该 cpp 文件的 Header 文件:

头文件

As you can see, the code model has no issues finding QDialog in the header file, but has so in the cpp file.如您所见,代码 model 在 header 文件中找到 QDialog 没有问题,但在 cpp 文件中却有。 I have the same issue in other files too.我在其他文件中也有同样的问题。 The project compiles without problems too.该项目编译也没有问题。 I already deleted the cache files in my build folder and reindexed all again.我已经删除了构建文件夹中的缓存文件并再次重新索引。 I can't find the log files of clang tho.我找不到 clang 的日志文件。

Disabling unity build fixed it.禁用统一构建修复了它。

Sometimes clandg code model gets lost when updating QtCreator or changing its compiler settings.有时,更新 QtCreator 或更改其编译器设置时, clandg代码 model 会丢失。 Last time上次

  1. Removing %APPDATA%\QtProject删除%APPDATA%\QtProject
  2. Removing %LOCALAPPDATA%\QtProject删除%LOCALAPPDATA%\QtProject
  3. Re-creating the project from scratch从头开始重新创建项目

has fixed the problem for me.已经为我解决了这个问题。

(The paths above are for Windows. For other platforms see Where QtCreator stores its settings and kits ) (以上路径适用于 Windows。对于其他平台,请参阅QtCreator 存储其设置工具包的位置)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM