find_package(MYSQL_CONCPP)错误--找不到MYSQL_CONCPP(缺少:MYSQL_CONCPP_DIR)

问题描述 投票:0回答:1

我从官网下载了mysql-connector-c++-8.4.0-winx64: enter image description here

然后我写CMakeLists.txt

\`#最低要求版本
cmake_minimum_required(VERSION 3.29)

#项目名称
project(hq)

set(CMAKE_PREFIX_PATH  "C:\\Users\\35497\\Desktop\\mysql-connector-c++-8.4.0-winx64" )

set(MYSQL_CONCPP_DIR "C:\\Users\\35497\\Desktop\\mysql-connector-c++-8.4.0-winx64")

message("CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}")
message("MYSQL_CONCPP_DIR=${MYSQL_CONCPP_DIR}")

find_package(MYSQL_CONCPP CONFIG  )

message("MYSQL_CONCPP_FOUND=${MYSQL_CONCPP_FOUND}")

message("MYSQL_CONCPP_LIBRARIES=${MYSQL_CONCPP_LIBRARIES}")

message("MYSQL_CONCPP_INCLUDE_DIRS=${MYSQL_CONCPP_INCLUDE_DIRS}")

message("mysql-concpp_VERSION=${mysql-concpp_VERSION}")\`

enter image description here

但是我还是找不到这个库。不知道问题出在哪里?非常感谢您帮我解决问题。

我尝试放到其他目录下,但好像还是找不到

cmake mysql-connector
1个回答
0
投票

我也遇到了这个问题,我下载了调试版本,但仍然出现

[CMake]   C:/Users/26621/Desktop/mysql-connector-c++-9.1.0-winx64/lib64.  (missing: 1> [CMake]   MYSQL_CONCPP_FOUND) (found version "9.1.0") 1> [CMake] Call Stack (most recent call first):
以上错误

© www.soinside.com 2019 - 2024. All rights reserved.