gpt4 book ai didi

c++ - 无法在我的 ubuntu 中正确安装 MySQL connector/c++

转载 作者:行者123 更新时间:2023-11-28 04:37:03 24 4
gpt4 key购买 nike

按照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
$ 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!

这是文档链接: MySql Installing Connector/C++ from Source

这是文档的相关部分。

To verify connector functionality, build and run one or more of the test programs included in the testapp directory of the source distribution. Create a directory to use and change location into it. Then issue the following commands:

$ cmake [other_options] -DWITH_CONCPP=concpp_install concpp_source/testapp

other_options consists of the options that you used to configure Connector/C++ itself (-G, WITH_BOOST, BUILD_STATIC, and so forth). concpp_source is the directory containing the Connector/C++ source code, and concpp_install is the directory where Connector/C++ is installed:

最佳答案

我也遇到了你的问题。这是我的解决方案:

$ git clone https://github.com/mysql/mysql-connector-cpp.git
$ cd mysql-connector-cpp
$ git checkout 8.0
$ mkdir build
$ cd build
# The problem is here: CMAKE_BUILD_TYPE default value is Debug
# so it install .so in WITH_CONCPP/lib64/debug.
$ cmake -DCMAKE_BUILD_TYPE=Release ..
# I don't know why the options "--config Debug( or Release)" is disable.
$ cmake --build .
$ sudo cmake --build . --target install
$ cmake -DWITH_CONCPP=/usr/local/mysql/connector-c++-8.0 ../testapp

关于c++ - 无法在我的 ubuntu 中正确安装 MySQL connector/c++,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51117349/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com