1

我正在尝试编译 MariaDB Connector v1.0.5 和/或 Mysql Connection v 5.3.4。

我在 Slackware 服务器上安装了 MariaDB Server v.10.0.21。我只需要让一个 MYSQL 连接器工作,不管是哪个。

还应用了在 Linux 上是否有与 Mariadb 10 兼容的 ODBC 驱动程序中提到的补丁

当我编译 MariaDB 连接器时,我收到一条错误消息“找不到 MariaDB”。

当我编译 Mysql 连接器时,我收到以下错误:

  • CMake 错误:此项目中使用了以下变量,但它们设置为 NOTFOUND。
  • 请设置它们或确保它们在 CMake 文件中正确设置和测试:MYSQL_LIB 由目录中的目标“myodbc5a”链接 /downloads/mysql-connector-odbc-5.3.4-src/driver 由目录中的目标“myodbc5w”链接/downloads/mysql-connector-odbc-5.3.4-src/driver 由目录中的目标“myodbc5S”链接 /downloads/mysql-connector-odbc-5.3.4-src/setupgui 由目录中的目标“myodbc-installer”链接/downloads/mysql-connector-odbc-5.3.4-src/installer

从错误文件中输出

确定 pthread_create 函数是否存在于 pthread 中失败,输出如下: Change Dir: /downloads/mysql-connector-odbc-5.3.4-src/CMakeFiles/CMakeTmp

运行构建命令:/usr/bin/gmake "cmTryCompileExec3523358880/fast" /usr/bin/gmake -f CMakeFiles/cmTryCompileExec3523358880.dir/build.make CMakeFiles/cmTryCompileExec3523358880.dir/build gmake 1:进入目录/downloads/mysql-connector-odbc-5.3.4-src/CMakeFiles/CMakeTmp' /usr/bin/cmake -E cmake_progress_report /downloads/mysql-connector-odbc-5.3.4-src/CMakeFiles/CMakeTmp/CMakeFiles 1 Building C object CMakeFiles/cmTryCompileExec3523358880.dir/CheckFunctionExists.c.o /usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTryCompileExec3523358880.dir/CheckFunctionExists.c.o -c /usr/share/cmake-2.8/Modules/CheckFunct ionExists.c Linking C executable cmTryCompileExec3523358880 /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec3523358880.dir/link.txt --verbose=1 /usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create CMakeFiles/cmTryCompileExec3523358880.dir/CheckFunctionExists.c.o -o cmTryCompileExec3523358880 -rdynamic -lpth reads /usr/lib64/gcc/x86_64-slackware-linux/4.8.2/../../../../x86_64-slackware-linux/bin/ld: cannot find -lpthreads collect2: error: ld returned 1 exit status gmake[1]: *** [cmTryCompileExec3523358880] Error 1 gmake[1]: Leaving directory/downloads/mysql-connector -odbc-5.3.4-src/CMakeFiles/CMakeTmp' gmake: *** [cmTryCompileExec3523358880/fast] 错误2

确定函数 dlopen 是否存在失败,输出如下: Change Dir: /downloads/mysql-connector-odbc-5.3.4-src/CMakeFiles/CMakeTmp

运行构建命令:/usr/bin/gmake "cmTryCompileExec1888052970/fast" /usr/bin/gmake -f CMakeFiles/cmTryCompileExec1888052970.dir/build.make CMakeFiles/cmTryCompileExec1888052970.dir/build gmake 1:进入目录/downloads/mysql-connector-odbc-5.3.4-src/CMakeFiles/CMakeTmp' /usr/bin/cmake -E cmake_progress_report /downloads/mysql-connector-odbc-5.3.4-src/CMakeFiles/CMakeTmp/CMakeFiles 1 Building C object CMakeFiles/cmTryCompileExec1888052970.dir/CheckFunctionExists.c.o /usr/bin/cc -DCHECK_FUNCTION_EXISTS=dlopen -o CMakeFiles/cmTryCompileExec1888052970.dir/CheckFunctionExists.c.o -c /usr/share/cmake-2.8/Modules/CheckFunctionExist s.c Linking C executable cmTryCompileExec1888052970 /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec1888052970.dir/link.txt --verbose=1 /usr/bin/cc -DCHECK_FUNCTION_EXISTS=dlopen CMakeFiles/cmTryCompileExec1888052970.dir/CheckFunctionExists.c.o -o cmTryCompileExec1888052970 -rdynamic CMakeFiles/cmTryCompileExec1888052970.dir/CheckFunctionExists.c.o: In functionmain':CheckFunctionExists.c :(.text+0x15): undefined reference to dlopen' collect2: error: ld returned 1 exit status gmake[1]: *** [cmTryCompileExec1888052970] Error 1 gmake[1]: Leaving directory/downloads/mysql-connector-odbc-5.3.4-src/CMakeFiles/CMakeTmp' gmake: *** [cmTryCompileExec1888052970/fast] 错误 2

块引用

4

1 回答 1

1

只需使用预编译版本。将库复制到 lib 并包含目录。

于 2015-10-29T14:59:30.110 回答