编译Licode报错:ifndef header guard has wrong style

14 篇文章 0 订阅

编译licode git上的master的时候,一切都很顺利,但下载release中的压缩包,解压并编译,当编译到erizoAPI的时候却报了很多相同的错误,都是说头文件的风格不对,错误如下:

MediaStream.h:2:  #ifndef header guard has wrong style, please use: _HOME_TOPSLUO_WORKSPACE_TEST_LICODE_PRE_V7_14_ERIZOAPI_MEDIASTREAM_H_  [build/header_guard]

后来通过查找编译脚本发现,在cpplint.py中找到一个参数:

--root=subdir
  The root directory used for deriving header guard CPP variable.
   By default, the header guard CPP variable is calculated as the relative path
    to teh directory that contains .git, .hg, or .svn, When this flag is specified, the relative 
    path is calculated from the specified directory. If the specified directory does not exist, 
    this flag is ignored.
    Examples:
    No flag => CHROME_BROWSER_UI_BROWSER_H_
    --root=chrome => BROWSER_UI_BROWSER_H_
    --root=chrome/browser => UI_BROWSER_H_

也就是说,如果当前目录下存在.git或者.svn等目录,root参数是会计算出来参数,否则–root参会被忽略掉,那就会出现开头说的错误。

问题正是如此,因为从master中clone下来的源码存在.git目录,而解压压缩包的源码中不存在.git目录,所以在调用cpplint.py的时候,可以指定–root参数来解决此问题,比如:

./cpplint.py --filter=-legal.copyright,-build/include --root=/home/topsluo/licode --linelength=120 *.cc *.h
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值