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

Does not compile without patched CMakeList.txt

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Not a Bug
    • 3.1.3
    • N/A
    • General
    • Alpine Linux

    Description

      Does not compile without patching CMakeList.txt to include /usr/include/mysql

      Patch here:

      --- mariadb-connector-odbc-3.1.3-ga-src/CMakeLists.txt
      +++ mariadb-connector-odbc-3.1.3-ga-src-patched/CMakeLists.txt
      @@ -144,6 +144,7 @@
       
       INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/libmariadb/include)
       INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR}/libmariadb/include)
      +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR} /usr/include/mysql)
       
       IF(WIN32)
         INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/dsn)
      

      Build error when not using patch:

      In file included from /home/joe/aports/testing/mariadb-connector-odbc/src/mariadb-connector-odbc-3.1.4/odbc_3_api.c:21:                                                                                                                                                          
      /home/joe/aports/testing/mariadb-connector-odbc/src/mariadb-connector-odbc-3.1.4/ma_odbc.h:32:10: fatal error: mysql.h: No such file or directory                                                                                                                                
       #include <mysql.h>                                                                                                                                                                                                                                                              
                ^~~~~~~~~                                                                                                                                                                                                                                                              
      compilation terminated.                                                                                                                                                                                                                                                          
      make[2]: *** [CMakeFiles/maodbc.dir/build.make:63: CMakeFiles/maodbc.dir/odbc_3_api.c.o] Error 1                                                                                                                                                                                 
      make[2]: *** Waiting for unfinished jobs....                                                                                                                                                                                                                                     
      In file included from /home/joe/aports/testing/mariadb-connector-odbc/src/mariadb-connector-odbc-3.1.4/ma_error.c:19:                                                                                                                                                            
      /home/joe/aports/testing/mariadb-connector-odbc/src/mariadb-connector-odbc-3.1.4/ma_odbc.h:32:10: fatal error: mysql.h: No such file or directory                                                                                                                                
       #include <mysql.h>                                                                                                                                                                                                                                                              
                ^~~~~~~~~                                                                                                                                                                                                                                                              
      compilation terminated.     
      

      Attachments

        Activity

          Thank you for your report.
          I assume you were building using source package.
          We usually build and encourage people to build with Connector/C as a sub-project. i.e. if you put Connector/C sources into libmariadb subdirectory of the root of Connector/ODBC source tree.
          If you use C/ODBC git checkout for that, it will work automatically. You can look into BUILD.md file for build instructions.
          If you still want to build from source package using installed in the system C/C libraries and headers, then should point somehow to compiler and linker to their location. e.g. you can do something like cmake -DCMAKE_C_FLAGS_RELWITHDEBINFO="-I/usr/include/mysql" .
          Please feel free to re-open the issue report if you still think there is something for us to fix here.

          Lawrin Lawrin Novitsky added a comment - Thank you for your report. I assume you were building using source package. We usually build and encourage people to build with Connector/C as a sub-project. i.e. if you put Connector/C sources into libmariadb subdirectory of the root of Connector/ODBC source tree. If you use C/ODBC git checkout for that, it will work automatically. You can look into BUILD.md file for build instructions. If you still want to build from source package using installed in the system C/C libraries and headers, then should point somehow to compiler and linker to their location. e.g. you can do something like cmake -DCMAKE_C_FLAGS_RELWITHDEBINFO="-I/usr/include/mysql" . Please feel free to re-open the issue report if you still think there is something for us to fix here.

          People

            Lawrin Lawrin Novitsky
            jjsearle Joe Searle
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.