Error when compiling Licode: ifndef header guard has wrong style

When compiling the master on licode git, everything went smoothly, but after downloading the compressed package in the release, decompressing and compiling, when compiling to erizoAPI, many of the same errors were reported, all saying that the style of the header file was wrong, error as follows:

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]

Later, by searching for the compiled script, I found a parameter in 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_

That is to say, if there are directories such as .git or .svn in the current directory, the root parameter will calculate the parameters, otherwise the –root parameter will be ignored, and the error mentioned at the beginning will appear.

This is exactly the problem, because the source code cloned from the master exists in the .git directory, but the source code of the decompressed compressed package does not exist in the .git directory, so when calling cpplint.py, you can specify the –root parameter to solve this problem. for example:

./cpplint.py --filter=-legal.copyright,-build/include --root=/home/topsluo/licode --linelength=120 *.cc *.h

Guess you like

Origin blog.csdn.net/TopsLuo/article/details/99644383