[Debug]SpaceVim中neomake报错 Error while trying to load a compilation database
回家装上archlinux,突发奇想装个SpaceVim写题
安装配置一路可以说是没有太大问题
最后在写题时出现如下问题
Error while trying to load a compilation database:
Could not auto-detect compilation database for file "poj-1458.cpp"
No compilation database found in /home/tanglizi/Code/acm/summerTraining/2018 or any parent directory
fixed-compilation-database: Error while opening fixed database: No such file or directory
json-compilation-database: Error while opening JSON database: No such file or directory
Running without flags.
查了查google,发现这是clang-check的问题,clang-check需要一个compile_commands.json文件(可由cmake生成)做到工程化check
那么问题迎刃而解
方法一
卸载clang,换上gcc
绝对暴力的方法,可以说很不优雅了
方法二
手写compile_commands.json文件,或者cmake一个工程
但是对ACM刷题党来讲,这个实在不方便
方法三
瞬间抛弃了前两个方法,于是开始修改vim插件
还是查了查google,发现问题在于一个名叫neomake插件
于是查找有关clang-check的文件,看看是怎么调用clang-check的
grep clang-check -R ~/.cache/vimfiles/repos/github.com
# /home/tanglizi/.cache/vimfiles/repos/github.com/neomake/neomake/autoload/neomake/makers/ft/c.vim: " 'exe': 'clang-check'
vim /home/tanglizi/.cache/vimfiles/repos/github.com/neomake/neomake/autoload/neomake/makers/ft/c.vim
可以看到第32行出现clang-check
function! neomake#makers#ft#c#clangcheck() abort
return {
\ 'exe': 'clang-check',
\ 'args': ['%:p'],
\ 'errorformat':
\ '%-G%f:%s:,' .
\ '%f:%l:%c: %trror: %m,' .
\ '%f:%l:%c: %tarning: %m,' .
\ '%I%f:%l:%c: note: %m,' .
\ '%f:%l:%c: %m,'.
\ '%f:%l: %trror: %m,'.
\ '%f:%l: %tarning: %m,'.
\ '%I%f:%l: note: %m,'.
\ '%f:%l: %m',
\ }
endfunction
于是在33行的args里面加上'--',同理处理clang-tidy(75行),就搞定了
\ 'args': ['%:p', '--'],
思路是在原命令后加上'--',clang就不查找compilation database了
clang-check file.cpp --
[Debug]SpaceVim中neomake报错 Error while trying to load a compilation database的更多相关文章
- 安卓中运行报错Error:Execution failed for task ':app:transformClassesWithDexForDebug'解决
在androidstuio中运行我的未完项目,报错: Error:Execution failed for task ':app:transformClassesWithDexForDebug'.&g ...
- node 中 npm报错 Error: ENOENT, stat 'C:\Users\Administrator\AppData\Roaming\npm'
今天在看node书本时,安装express,看看里面的包.没想到出现这样一种情况. 报错了.后来思考了一下,可能是修改了node的默认安装路径.于是准备在出错的路径下建一个npm文件夹. 注意,有个时 ...
- Zabbix导入MySQL数据库报错ERROR 1046 (3D000) at line 1: No database selected
使用如下命令导入Zabbix数据库时报错 解决办法: 1.先把原始的数据库压缩包备份 cd /usr/share/doc/zabbix-server-mysql-4.0.7/ cp create.sq ...
- debug运行java程序报错
debug运行java程序报错 ERROR: transport error 202: connect failed: Connection timed out ERROR: JDWP Transpo ...
- springboot启动报错,Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
报错: Error starting ApplicationContext. To display the conditions report re-run your application with ...
- linux使用wkhtmltopdf报错error while loading shared libraries:
官网提示 linux需要这些动态库.depends on: zlib, fontconfig, freetype, X11 libs (libX11, libXext, libXrender) 在li ...
- 运行编译后的程序报错 error while loading shared libraries: lib*.so: cannot open shared object file: No such file or directory
运行编译后的程序报错 error while loading shared libraries: lib*.so: cannot open shared object file: No such f ...
- mysql报错"ERROR 1206 (HY000): The total number of locks exceeds the lock table size"的解决方法
1. 问题背景 InnoDB是新版MySQL(v5.5及以后)默认的存储引擎,之前版本的默认引擎为MyISAM,因此,低于5.5版本的mysql配置文件.my.cnf中,关于InnoD ...
- wince6.0 编译报错:"error C2220: warning treated as error - no 'object' file generated"的解决办法
内容提要:wince6.0编译报错:"error C2220: warning treated as error - no 'object' file generated" 原因是 ...
随机推荐
- div纵向居中的方法(转载)
方法一这个方法把一些 div 的显示方式设置为表格,因此我们可以使用表格的 vertical-align property 属性. <div id="wrapper"> ...
- CF993C Careful Maneuvering bitset_枚举
Code: #include<cstdio> #include<map> #include<iostream> #include<cmath> #inc ...
- 基础——(4)D Latch(D锁存器)
S-R Latch Put a inverter there: Invertor的组成: tie both of the inputs together加上一个nor gate 就能组成一个inver ...
- C++函数传递数组的两种方式
数组与指针. 传首地址过去,然后通过地址输出数组元素. 1.一维数组 #include<iostream> using namespace std; #include <cstrin ...
- vue自定义组件并使用
以下是使用自己写的一个简单的文件上传框为例 1.自定义组件结构(一个js文件,一个vue文件),最好单独放一个文件 2.upload.vue 内容 其中,action是父组件传递给子组件的参数,使用p ...
- Vue 实现前进刷新,后退不刷新的效果
需求一: 在一个列表页中,第一次进入的时候,请求获取数据.点击某个列表项,跳到详情页,再从详情页后退回到列表页时,不刷新.也就是说从其他页面进到列表页,需要刷新获取数据,从详情页返回到列表页时不要刷新 ...
- HDU 4329 Contest 3
果然换个编译器就过了.总的来说,不难,不过就是处理一些空格.学习了一个新的类 istringstream可以按空格划分.然后,那条式子要理解. 式子的意义是: 找到一个串,该串在query中是第几个找 ...
- shell脚本学习之ubuntu删除多余内核
#!/bin/bash #定期删除内核 #存储命令输出cmd_output=`commands` uname_output=$(uname -r) kernel_output=`dpkg --list ...
- Spring boot 使用@Value注入属性
Spring boot 使用@Value注入属性 学习了:http://blog.csdn.net/hry2015/article/details/72353994 如果启动的时候报错: spring ...
- Android View 事件分发机制 源代码解析 (上)
一直想写事件分发机制的文章,无论咋样,也得自己研究下事件分发的源代码.写出心得~ 首先我们先写个简单的样例来測试View的事件转发的流程~ 1.案例 为了更好的研究View的事件转发,我们自定以一个M ...