Uploaded image for project: 'MariaDB Connector/ODBC'
  1. MariaDB Connector/ODBC
  2. ODBC-135

Build failure due to linker error

    XMLWordPrintable

Details

    • Task
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 3.0.2
    • 2.0.17, 3.0.5
    • General
    • None
    • Arch: Intel 64 bit
      OS: Ubuntu 17.10

    Description

      While trying to build MariaDB Connector ODBC 3.0.2 from source, got the following linking error:

      [ 31%] Linking C executable result2
      /usr/local/mysql/lib//libmariadbclient.a(ma_compress.c.o): In function `_mariadb_compress_alloc':
      /home/test/mariadb-10.2.11/libmariadb/libmariadb/ma_compress.c:55: undefined reference to `compress'
      /usr/local/mysql/lib//libmariadbclient.a(ma_compress.c.o): In function `_mariadb_uncompress':
      /home/test/mariadb-10.2.11/libmariadb/libmariadb/ma_compress.c:78: undefined reference to `uncompress'
      collect2: error: ld returned 1 exit status
      test/CMakeFiles/result2.dir/build.make:99: recipe for target 'test/result2' failed
      make[2]: *** [test/result2] Error 1
      CMakeFiles/Makefile2:170: recipe for target 'test/CMakeFiles/result2.dir/all' failed
      make[1]: *** [test/CMakeFiles/result2.dir/all] Error 2
      Makefile:151: recipe for target 'all' failed
      make: *** [all] Error 2
      

      Editing the CMakeLists.txt file fixed the issue.

      --- ../../mariadb-connector-odbc-3.0.2/CMakeLists.txt.orig    2018-01-04 09:56:24.368084074 +0000
      +++ ../../mariadb-connector-odbc-3.0.2/CMakeLists.txt 2018-01-04 09:57:13.818084074 +0000
      @@ -207,6 +207,14 @@
       
       ENDIF()
       
      +find_package(ZLIB)
      +if (ZLIB_FOUND)
      +     MESSAGE(STATUS "Configuring to build with ZLIB")
      +     include_directories(${ZLIB_INCLUDE_DIRS})
      +     ADD_DEFINITIONS(-DHAVE_ZLIB)
      +     SET(PLATFORM_DEPENDENCIES ${PLATFORM_DEPENDENCIES} ${ZLIB_LIBRARIES})
      +endif()
      +
       IF(WIN32 OR WITH_OPENSSL)
         IF(WITH_OPENSSL)
           FIND_PACKAGE(OpenSSL)
      

      Attached the build steps used. Is editing CMakeLists.txt necessary?

      Attachments

        Issue Links

          Activity

            People

              Lawrin Lawrin Novitsky
              Faiz Faiz Akhtar
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.