无法在我的ubuntu中正确安装MySQL连接器/c++
我按照Mysql给出的说明进行了操作,但是当我想要测试它时,我遇到了一个错误 以下是我的意见:无法在我的ubuntu中正确安装MySQL连接器/c++,c++,mysql,mysql-error-1064,connector,C++,Mysql,Mysql Error 1064,Connector,我按照Mysql给出的说明进行了操作,但是当我想要测试它时,我遇到了一个错误 以下是我的意见: $ git clone https://github.com/mysql/mysql-connector-cpp.git $ cd mysql-connector-cpp $ git checkout 8.0 $ mkdir build $ cd build $ cmake .. $ cmake --build . $ sudo cmake --build . --target install $ c
$ git clone https://github.com/mysql/mysql-connector-cpp.git
$ cd mysql-connector-cpp
$ git checkout 8.0
$ mkdir build
$ cd build
$ cmake ..
$ cmake --build .
$ sudo cmake --build . --target install
$ cmake -DWITH_CONCPP=/usr/local/mysql/connector-c++-8.0 ../testapp
我犯了一个错误:
Using dynamic runtime library.
Generationg 64bit code
Looking for connector libraries here: /usr/local/mysql/connector-c++-8.0/lib64
Looking for the main library mysqlcppconn8
CMake Error at CMakeLists.txt:165 (message):
Could not find MySQL Connector/C++ 8.0 library mysqlcppconn8 at specified
location: /usr/local/mysql/connector-c++-8.0/lib64
-- Configuring incomplete, errors occurred!
以下是文档链接:
这是文件的相关部分
要验证连接器功能,请生成并运行源发行版的testapp目录中包含的一个或多个测试程序。创建要使用的目录,并将位置更改为该目录。然后发出以下命令:
$cmake[其他选项]-DWITH_CONCPP=CONCPP\u安装CONCPP\u源代码/testapp
其他_选项包括用于配置的选项
Connector/C++本身-G,带有BOOST、BUILD\u STATIC等等。
concpp_source是包含连接器/C++源的目录
代码,concpp_install是Connector/C++所在的目录
已安装:
我也遇到了你的问题。这是我的解决方案: $git克隆https://github.com/mysql/mysql-connector-cpp.git $cd mysql连接器cpp $git签出8.0 $mkdir构建 $cd构建 问题就在这里:CMAKE_BUILD_TYPE的默认值是Debug 因此,它需要安装。 $cmake-DCMAKE\u BUILD\u TYPE=发布。。 我不知道为什么选项-config Debug或Release是禁用的。 $cmake-build。 $sudo cmake-构建-目标安装 $cmake-DWITH_CONCPP=/usr/local/mysql/connector-c++-8.0../testapp