回家装上archlinux,突发奇想装个SpaceVim写题

安装配置一路可以说是没有太大问题

最后在写题时出现如下问题

  1. Error while trying to load a compilation database:
  2. Could not auto-detect compilation database for file "poj-1458.cpp"
  3. No compilation database found in /home/tanglizi/Code/acm/summerTraining/2018 or any parent directory
  4. fixed-compilation-database: Error while opening fixed database: No such file or directory
  5. json-compilation-database: Error while opening JSON database: No such file or directory
  6. 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的

  1. grep clang-check -R ~/.cache/vimfiles/repos/github.com
  2. # /home/tanglizi/.cache/vimfiles/repos/github.com/neomake/neomake/autoload/neomake/makers/ft/c.vim: " 'exe': 'clang-check'
  3. vim /home/tanglizi/.cache/vimfiles/repos/github.com/neomake/neomake/autoload/neomake/makers/ft/c.vim

可以看到第32行出现clang-check

  1. function! neomake#makers#ft#c#clangcheck() abort
  2. return {
  3. \ 'exe': 'clang-check',
  4. \ 'args': ['%:p'],
  5. \ 'errorformat':
  6. \ '%-G%f:%s:,' .
  7. \ '%f:%l:%c: %trror: %m,' .
  8. \ '%f:%l:%c: %tarning: %m,' .
  9. \ '%I%f:%l:%c: note: %m,' .
  10. \ '%f:%l:%c: %m,'.
  11. \ '%f:%l: %trror: %m,'.
  12. \ '%f:%l: %tarning: %m,'.
  13. \ '%I%f:%l: note: %m,'.
  14. \ '%f:%l: %m',
  15. \ }
  16. endfunction

于是在33行的args里面加上'--',同理处理clang-tidy(75行),就搞定了

  1. \ 'args': ['%:p', '--'],

思路是在原命令后加上'--',clang就不查找compilation database了

  1. clang-check file.cpp --

[Debug]SpaceVim中neomake报错 Error while trying to load a compilation database的更多相关文章

  1. 安卓中运行报错Error:Execution failed for task ':app:transformClassesWithDexForDebug'解决

    在androidstuio中运行我的未完项目,报错: Error:Execution failed for task ':app:transformClassesWithDexForDebug'.&g ...

  2. node 中 npm报错 Error: ENOENT, stat 'C:\Users\Administrator\AppData\Roaming\npm'

    今天在看node书本时,安装express,看看里面的包.没想到出现这样一种情况. 报错了.后来思考了一下,可能是修改了node的默认安装路径.于是准备在出错的路径下建一个npm文件夹. 注意,有个时 ...

  3. 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 ...

  4. debug运行java程序报错

    debug运行java程序报错 ERROR: transport error 202: connect failed: Connection timed out ERROR: JDWP Transpo ...

  5. 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 ...

  6. linux使用wkhtmltopdf报错error while loading shared libraries:

    官网提示 linux需要这些动态库.depends on: zlib, fontconfig, freetype, X11 libs (libX11, libXext, libXrender) 在li ...

  7. 运行编译后的程序报错 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 ...

  8. 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 ...

  9. wince6.0 编译报错:"error C2220: warning treated as error - no 'object' file generated"的解决办法

    内容提要:wince6.0编译报错:"error C2220: warning treated as error - no 'object' file generated" 原因是 ...

随机推荐

  1. C++_String_类字符串操作(转)

    从百度文库找的,挺详细的,跟大家分享一下. 标红的是我觉得用的比较多,并且大家不太熟悉的. string类的构造函数: string(const char *s);     //用c字符串s初始化 s ...

  2. (2)pyspark建立RDD以及读取文件成dataframe

    别人的相关代码文件:https://github.com/bryanyang0528/hellobi/tree/master/pyspark 1.启动spark (1)SparkSession 是 S ...

  3. ES modules

    注意:这篇文章讲的是正经的es module规范 及浏览器的实现!webpack项目中es module会被parse成commonjs,和这个没大关系! 总结: ES模块加载的主要过程: 构造 —— ...

  4. How Google Backs Up The Internet Along With Exabytes Of Other Data

    出处:http://highscalability.com/blog/2014/2/3/how-google-backs-up-the-internet-along-with-exabytes-of- ...

  5. poj 3254 Corn Fields (状压dp)(棋盘dp)

    状压dp入门题 因为当前行的状态只和上一行有关 所以可以一行一行来做 因为m <= 12所以可以用二进制来表示放了或者没有放 0表示没放,1表示放 f[i][state]表示第i行状态为stat ...

  6. Golang-import-introduce

    本文主要讲解golang中import关键字的用法 import( "fmt" ) //然后在代码里面可以通过如下的方式调用 fmt.Println("hello wor ...

  7. jvm 堆、栈 、方法区概念和联系

    一.三者联系 1.堆:解决数据的存储问题( 即 数据怎么放,放到哪 ). 2.栈:解决程序运行的问题( 即 程序如何执行,或者说如何处理数据 ). 3.方法区:辅助堆栈的一块永久区,解决堆栈信息的产生 ...

  8. 楼宇自控-BA系统流程总图

    总结一下过程中的节点和技能,希望能对其他人有所帮助

  9. ASP.NET-服务器客户端的信息保持

    ASP.NET客户端和服务器端的信息保持方案 来自为知笔记(Wiz)

  10. 洛谷——P2822 组合数问题

    https://www.luogu.org/problem/show?pid=2822 题目描述 组合数C_n^mC​n​m​​表示的是从n个物品中选出m个物品的方案数.举个例子,从(1,2,3) 三 ...