简体   繁体   English

Syntastic抱怨文件丢失

[英]Syntastic complaining about missing file

I am working on a c++ project utilizing Qt. 我正在利用Qt进行c ++项目。 I have enabled syntastic to check headers through my vimrc, and its checkers (gcc, clang_check, and clang_tidy) all complain about the same thing in my project: they're unable to find a particular header file. 我已经启用syntastic来通过我的vimrc检查头文件,并且它的检查器(gcc,clang_check和clang_tidy)都在我的项目中抱怨同样的事情:他们找不到特定的头文件。

The header file in question is 'QtCore/qconfig-64.h'. 有问题的头文件是“ QtCore / qconfig-64.h”。 And they are correct that this file does not exist. 他们是正确的,该文件不存在。 The problem is that this file should not be loaded into the project as it is a 32-bit project. 问题在于此文件不应加载到项目中,因为它是32位项目。 'QtCore/qconfig.h' has a preprocessor direction informing the project what to include: “ QtCore / qconfig.h”具有预处理器方向,用于通知项目要包括的内容:

#if __WORDSIZE == 32
#include "QtCore/qconfig-32.h"
#elif __WORDSIZE == 64
#include "QtCore/qconfig-64.h" 
#else
#error "unexpected value for __WORDSIZE macro"
#endif

Is there any proper solution to get syntastic to recognize the preprocessor directive choosing which header file to include? 是否有任何适当的解决方案可以使合成器识别预处理程序指令,从而选择要包含的头文件? If not, what other work arounds might be available to silence these errors while minimizing loss of utility? 如果不是,可以使用其他解决方法来消除这些错误,同时最大程度地减少实用程序的损失?

See :h 'syntastic_quiet_messages' , try this for your case 参见:h 'syntastic_quiet_messages' ,尝试这种情况

let g:syntastic_c_gcc_quiet_messages = {
        \ "regex": ['\mQtCore/qconfig-64\.h']
        \}

Note: QtCore/qconfig-64\\.h can be expanded to full error message to try to avoid missing other messages with same string 注意: QtCore/qconfig-64\\.h可以扩展为完整的错误消息,以尝试避免丢失其他具有相同字符串的消息

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

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