跳到主要内容

CMake 错误解决

缺少 GTest

Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY)
Call Stack (most recent call first):
/usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.16/Modules/FindGTest.cmake:205 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
lib/sqlalchemy/testing/CMakeLists.txt:2 (find_package)

安装 GTest

sudo apt install libgtest-dev

版本

VERSION not allowed unless CMP0048 is set to NEW
CMake Warning (dev) at src/CMakeLists.txt:3 (project):
Policy CMP0048 is not set: project() command manages VERSION variables.
Run "cmake --help-policy CMP0048" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.

The following variable(s) would be set to empty:

PROJECT_VERSION
PROJECT_VERSION_MAJOR
PROJECT_VERSION_MINOR
PROJECT_VERSION_PATCH
This warning is for project developers. Use -Wno-dev to suppress it.

链接库顺序

$ ldd ./src/libldal.so 
linux-vdso.so.1 (0x00007ffcf3fe3000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fb9d9de0000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fb9d9dbd000)
libev.so.4 => /lib/x86_64-linux-gnu/libev.so.4 (0x00007fb9d9daa000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fb9d9bb8000)
/lib64/ld-linux-x86-64.so.2 (0x00007fb9d9f62000)
$ ldd ./src/libldal.so 
linux-vdso.so.1 (0x00007ffde629d000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f8ebe196000)
libev.so.4 => /lib/x86_64-linux-gnu/libev.so.4 (0x00007f8ebe183000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f8ebe160000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f8ebdf6e000)
/lib64/ld-linux-x86-64.so.2 (0x00007f8ebe318000)