compile with link
g++ -I .\lib\a\ .\main.cc .\lib\a\a.c -o test.exe
static library
# 生成机器码
g++ -I .\lib\a\ -c .\lib\a\a.c -o .\obj\a.o
# 打包
ar -rcs liba.a .\obj\a.o
# compile with liba
g++ -I .\lib\a .\main.cc .\liba.a -o test.exe
mkdir build
cd build
cmake -G Ninja -DCMAKE_EXPORT_COMPILE_COMMANDS=True ..
ninja
{
"compileCommands": "build/compile_commands.json"
}