0

我正在使用 XAMPP 安装和运行 MySQL,当我运行时me@host:/path/to/mysql-connector-cpp> cmake .,它会抛出

-- BOOST_INCLUDE_DIRS=/usr/local/include
-- ENV{MYSQL_DIR} = 
CMake Error at FindMySQL.cm:202 (MESSAGE):
  mysql_config wasn't found, -DMYSQL_CONFIG_EXECUTABLE=...
Call Stack (most recent call first):
  CMakeLists.txt:166 (INCLUDE)


CMake Error at FindMySQL.cm:204 (MESSAGE):
  Cannot find MySQL.  Include dir: MYSQL_INCLUDE_DIR-NOTFOUND library dir:
  cxxflags:
Call Stack (most recent call first):
  CMakeLists.txt:166 (INCLUDE)


-- Configuring incomplete, errors occurred!

我正在使用 XAMPP,所以我确定 cmake 在错误的目录中寻找 MySQL。我如何告诉它它的位置?

4

1 回答 1

0

您可以将其指向正确的mysql-config可执行文件:

cmake -D MYSQL_CONFIG_EXECUTABLE=/path/to/mysql-config .

或者您可以只定义所需的变量:

cmake -D MYSQL_INCLUDE_DIR=... -D MYSQL_LIBRARY_DIR .
于 2012-06-22T08:18:48.730 回答