vscode开发,生成compile_commands.json
bear插件报错
ld.so: object '/usr/${LIB}/bear/libear.so' from LD_PRELOAD
bear -h
usage: bear [-h] [--version] [--verbose] [--cdb <file>] [--use-cc <path>]
[--use-c++ <path>] [--append] [--libear LIBEAR]
...
positional arguments:
build Command to run.
optional arguments:
-h, --help show this help message and exit
--version show program's version number and exit
--verbose, -v Enable verbose output from 'bear'. A second, third and
fourth flags increases verbosity. (default: 0)
--cdb <file>, -o <file>
The JSON compilation database. (default:
compile_commands.json)
--use-cc <path> Hint 'bear' to classify the given program name as C
compiler. (default: cc)
--use-c++ <path> Hint 'bear' to classify the given program name as C++
compiler. (default: c++)
advanced options:
--append, -a Extend existing compilation database with new entries.
Duplicate entries are detected and not present in the
final output. The output is not continuously updated,
it's done when the build command finished. (default:
False)
--libear LIBEAR, -l LIBEAR
specify libear file location. (default:
/usr/${LIB}/bear/libear.so)
解决方式
find一下
find /usr/ -name "*bear*"
找到之后指导libbear路径
bear -l /usr/lib/x86_64-linux-gnu/bear/libear.so make -j4