我是一名相对新手的程序员,最近开始使用boost。在成功地将库与cmake链接后,我注意到我的vim(我想是syntastic插件)可以很好地突出语法错误。但自从我开始包含boost库以来,它就停留在#include语句处(没有这样的文件/目录),并且无法显示文件中的任何语法错误。我已经到处搜索,但无法找到解决方案,允许我在编译阶段之前检查坏代码的语法。任何帮助都将不胜感激。
我无法发布截图(评分太低),但会发布代码供参考。
#include <iostream>
#include <boost/regex.hpp> <--------------syntax error (though it compiles fine)
#include <algorithm>
using namespace std;
void testMatch(const boost::regex& ex,const string st){
cout<<"Matching" <<st <<endl;
if(boost::regex_match(ex,st)){
cout<<"matches"<<endl
}
else cout<<"oops"; }
void testSearch(const boost::regex& ex, const string st){
cout<<"Searching"<<endl;
}