编译 MariaDB 连接器 v1.0.5 and/or Mysql 连接 v 5.3.4

Compiling MariaDB Connector v1.0.5 and/or Mysql Connection v 5.3.4

我正在尝试编译 MariaDB Connector v1.0.5 and/or Mysql Connection v 5.3.4.

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

还应用了Is there compatible ODBC driver with Mariadb 10 on Linux?

中提到的补丁

当我编译 MariaDB 连接器时,我收到一条错误消息 "MariaDB not found"。

当我编译 Mysql 连接器时,出现以下错误:

  • CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
  • Please set them or make sure they are set and tested correctly in the CMake files: MYSQL_LIB linked by target "myodbc5a" in directory /downloads/mysql-connector-odbc-5.3.4-src/driver linked by target "myodbc5w" in directory /downloads/mysql-connector-odbc-5.3.4-src/driver linked by target "myodbc5S" in directory /downloads/mysql-connector-odbc-5.3.4-src/setupgui linked by target "myodbc-installer" in directory /downloads/mysql-connector-odbc-5.3.4-src/installer

错误文件中的 OUTOUT

Determining if the function pthread_create exists in the pthreads failed with the following output: Change Dir: /downloads/mysql-connector-odbc-5.3.4-src/CMakeFiles/CMakeTmp

Run Build Command:/usr/bin/gmake "cmTryCompileExec3523358880/fast" /usr/bin/gmake -f CMakeFiles/cmTryCompileExec3523358880.dir/build.make CMakeFiles/cmTryCompileExec3523358880.dir/build gmake1: Entering directory /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] Error 2

Determining if the function dlopen exists failed with the following output: Change Dir: /downloads/mysql-connector-odbc-5.3.4-src/CMakeFiles/CMakeTmp

Run Build Command:/usr/bin/gmake "cmTryCompileExec1888052970/fast" /usr/bin/gmake -f CMakeFiles/cmTryCompileExec1888052970.dir/build.make CMakeFiles/cmTryCompileExec1888052970.dir/build gmake1: Entering directory /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] Error 2

Blockquote

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