如何解决C ++ FindMySQL.cmake无法将MySQL Connector与Cmake连接
我正在Ubuntu上运行它。
我的根目录CMakeLists.txt中有此文件:
find_package(MySQL)
if(NOT MySQL_FOUND)
message(FATAL_ERROR "Could not MySQL Library has not been found!")
endif()
include_directories(${MYSQL_INCLUDE_DIR})
我用以下方法安装了连接器:
sudo apt-get install libmysqlcppconn-dev
当我尝试重新加载CMake时,出现以下警告:
CMake Warning at CMakeLists.txt:13 (find_package):
By not providing "FindMySQL.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "MySQL",but
CMake did not find one.
Could not find a package configuration file provided by "MySQL" with any of
the following names:
MySQLConfig.cmake
mysql-config.cmake
Add the installation prefix of "MySQL" to CMAKE_PREFIX_PATH or set
"MySQL_DIR" to a directory containing one of the above files. If "MySQL"
provides a separate development package or SDK,be sure it has been
installed.
CMake Error at CMakeLists.txt:16 (message):
Could not MySQL Library has not been found!
似乎找不到MySQL,但是我已经安装了它。我该如何解决这个问题?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。