Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. "Cannot find file: mysql.pro" while building MySQL driver in Qt
Forum Updated to NodeBB v4.3 + New Features

"Cannot find file: mysql.pro" while building MySQL driver in Qt

Scheduled Pinned Locked Moved Solved General and Desktop
34 Posts 6 Posters 10.8k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • SGaistS SGaist

    You'll likely have to escape the spaces in the path. Or use the good old 8.3 notation. By the way, use forward slashes for your path. Qt will handle conversion for your properly.

    C Offline
    C Offline
    CrowSun
    wrote on last edited by
    #18

    @SGaist There isso much spaces in MySql folders by default. Idk how to avoid them properly.
    Anyway, i tries with forward slashes:
    "C:\Qt\5.7\Src\qtbase\src\plugins\sqldrivers\mysql>qmake "INCLUDEPATH+=C:/Program Files/MySQL/MySQL Connector C 6.1/include" "LIBS+=C:/Program Files/MySQL/MySQL Connector C 6.1/lib/libmysql.lib" mysql.pro"

    and get the same error...I made something wrong again?

    p.s. sorry, but what is that 8.3 notation? never heard before (shame on me)

    1 Reply Last reply
    0
    • SGaistS SGaist

      You'll likely have to escape the spaces in the path. Or use the good old 8.3 notation. By the way, use forward slashes for your path. Qt will handle conversion for your properly.

      C Offline
      C Offline
      CrowSun
      wrote on last edited by
      #19

      @SGaist will it became a solution for my problem if I'll take all needed folders(include) and libs(libmysql.lib) to another created folder without spaces and use this new pathes in my command? Will it work or it will cause just a new problems?

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #20

        https://en.wikipedia.org/wiki/8.3_filename

        It should be good to build the plugin.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        C 1 Reply Last reply
        0
        • SGaistS SGaist

          https://en.wikipedia.org/wiki/8.3_filename

          It should be good to build the plugin.

          C Offline
          C Offline
          CrowSun
          wrote on last edited by
          #21

          @SGaist so that solution is valid? to replace files in folder.
          Or I should avoid it and try an 8.3 notation?

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #22

            Replace ? I thought you wanted to copy the headers and libraries in their own folder without spaces. That or the notation should both work.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            C 1 Reply Last reply
            0
            • SGaistS SGaist

              Replace ? I thought you wanted to copy the headers and libraries in their own folder without spaces. That or the notation should both work.

              C Offline
              C Offline
              CrowSun
              wrote on last edited by
              #23

              @SGaist I made a try with copying only now and in the end of that huge text block I receive an error.

              C:\Qt\5.7\Src\qtbase\src\plugins\sqldrivers\mysql>qmake "INCLUDEPATH+=C:\MySQLDev\include" "LIBS+=C:\MySQLDev\lib\libmysql.lib" mysql.pro

              C:\Qt\5.7\Src\qtbase\src\plugins\sqldrivers\mysql>mingw32-make

              mingw32-make -f Makefile.Release all
              mingw32-make[1]: Entering directory 'C:/Qt/5.7/Src/qtbase/src/plugins/sqldrivers/mysql'
              g++ -Wl,-s -shared -Wl,-subsystem,windows -Wl,--out-implib,C:\Qt\5.7\Src\qtbase\plugins\sqldrivers\libqsqlmysql.a -o ........\plugins\sqldrivers\qsqlmysql.dll .obj/release/main.o .obj/release/qsql_mysql.o .obj/release/moc_qsql_mysql_p.o C:\MySQLDev\lib\libmysql.lib -LC:\Qt\5.7\mingw53_32\lib C:\Qt\5.7\mingw53_32\lib\libQt5Sql.a C:\Qt\5.7\mingw53_32\lib\libQt5Core.a -LC:\utils\my_sql\my_sql\lib -LC:\utils\postgresql\pgsql\lib .obj\release\qsqlmysql_resource_res.o
              .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x16e): undefined reference to mysql_num_rows@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x199): undefined reference to mysql_stmt_num_rows@4'
              .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x22d): undefined reference to mysql_num_rows@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x257): undefined reference to mysql_stmt_num_rows@4'
              .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x458): undefined reference to mysql_character_set_name@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x4f1): undefined reference to mysql_stmt_error@4'
              .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x4fe): undefined reference to mysql_stmt_errno@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x751): undefined reference to mysql_error@4'
              .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x760): undefined reference to mysql_errno@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x8ba): undefined reference to mysql_errno@4'
              .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x99e): undefined reference to mysql_errno@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x9b5): undefined reference to mysql_field_seek@8'
              .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x9dc): undefined reference to mysql_field_seek@8' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x9e7): undefined reference to mysql_fetch_field@4'
              .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0xa2c): undefined reference to mysql_fetch_field@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0xae9): undefined reference to mysql_stmt_insert_id@4'
              .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0xb29): undefined reference to mysql_insert_id@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0xd33): undefined reference to mysql_fetch_row@4'
              .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0xd77): undefined reference to mysql_stmt_fetch@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0xe92): undefined reference to mysql_stmt_data_seek@12'
              .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0xea0): undefined reference to mysql_stmt_fetch@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0xf0e): undefined reference to mysql_data_seek@12'
              .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0xf1c): undefined reference to mysql_fetch_row@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x10e7): undefined reference to mysql_fetch_lengths@4'
              .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x2728): undefined reference to mysql_init@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x288e): undefined reference to mysql_ssl_set@24'
              .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x2a99): undefined reference to mysql_real_connect@32' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x2ba4): undefined reference to mysql_close@4'
              .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x2eab): undefined reference to mysql_set_character_set@8' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x2ec2): undefined reference to mysql_get_client_version@0'
              .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x2ee0): undefined reference to mysql_thread_init@0' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x2f52): undefined reference to mysql_real_connect@32'
              .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x315e): undefined reference to mysql_ssl_set@24' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x31cb): undefined reference to mysql_options@12'
              .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x31fb): undefined reference to mysql_options@12' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x322b): undefined reference to mysql_options@12'
              .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x3474): undefined reference to mysql_select_db@8' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x35b6): undefined reference to mysql_close@4'
              .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x35d6): undefined reference to mysql_options@12' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x35f4): undefined reference to mysql_get_server_version@4'
              .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x39f4): undefined reference to mysql_thread_end@0' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x39ff): undefined reference to mysql_close@4'
              .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x3fc9): undefined reference to mysql_list_fields@12' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x4026): undefined reference to mysql_fetch_field@4'
              .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x4035): undefined reference to mysql_free_result@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x41ca): undefined reference to mysql_query@8'
              .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x430a): undefined reference to mysql_query@8' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x444a): undefined reference to mysql_query@8'
              .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x46d6): undefined reference to mysql_get_server_version@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x4ae3): undefined reference to mysql_list_tables@8'
              .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x4b21): undefined reference to mysql_data_seek@12' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x4b2c): undefined reference to mysql_fetch_row@4'
              .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x4c14): undefined reference to mysql_free_result@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x4da7): undefined reference to mysql_free_result@4'
              .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x4e1d): undefined reference to mysql_next_result@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x4e37): undefined reference to mysql_stmt_close@4'
              .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x4e5b): undefined reference to mysql_free_result@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x4f59): undefined reference to mysql_store_result@4'
              .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x4f6c): undefined reference to mysql_free_result@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x5194): undefined reference to mysql_real_query@12'
              .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x52f9): undefined reference to mysql_store_result@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x537f): undefined reference to mysql_field_count@4'
              .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x53ed): undefined reference to mysql_affected_rows@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x547c): undefined reference to mysql_fetch_field_direct@8'
              .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x553e): undefined reference to mysql_field_count@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x55cb): undefined reference to mysql_num_fields@4'
              .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x56c4): undefined reference to mysql_fetch_field@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x57b6): undefined reference to mysql_stmt_result_metadata@4'
              .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x5a3e): undefined reference to mysql_next_result@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x5a8f): undefined reference to mysql_store_result@4'
              .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x5ad2): undefined reference to mysql_field_count@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x5c2a): undefined reference to mysql_free_result@4'
              .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x5cc6): undefined reference to mysql_affected_rows@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x5d5c): undefined reference to mysql_fetch_field_direct@8'
              .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x5ecc): undefined reference to mysql_stmt_prepare@12' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x5ffb): undefined reference to mysql_stmt_init@4'
              .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x60f7): undefined reference to mysql_stmt_param_count@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x6169): undefined reference to mysql_stmt_param_count@4'
              .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x623d): undefined reference to mysql_stmt_reset@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x640b): undefined reference to mysql_stmt_param_count@4'
              .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x6425): undefined reference to mysql_stmt_execute@4' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x6576): undefined reference to mysql_stmt_affected_rows@4'
              .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x65a3): undefined reference to mysql_stmt_bind_result@8' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x65cb): undefined reference to mysql_stmt_store_result@4'
              .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x65f9): undefined reference to mysql_stmt_bind_result@8' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x663e): undefined reference to mysql_stmt_param_count@4'
              .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x68c2): undefined reference to mysql_stmt_bind_param@8' .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x6df1): undefined reference to mysql_stmt_attr_set@12'
              .obj/release/qsql_mysql.o:qsql_mysql.cpp:(.text+0x7099): undefined reference to `mysql_real_escape_string@16'
              collect2.exe: error: ld returned 1 exit status
              Makefile.Release:65: recipe for target '........\plugins\sqldrivers\qsqlmysql.dll' failed
              mingw32-make[1]: *** [........\plugins\sqldrivers\qsqlmysql.dll] Error 1
              mingw32-make[1]: Leaving directory 'C:/Qt/5.7/Src/qtbase/src/plugins/sqldrivers/mysql'
              Makefile:38: recipe for target 'release-all' failed
              mingw32-make: *** [release-all] Error 2

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #24

                Are you sure that your MySQL library is built for MinGW ?

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                C 1 Reply Last reply
                1
                • SGaistS SGaist

                  Are you sure that your MySQL library is built for MinGW ?

                  C Offline
                  C Offline
                  CrowSun
                  wrote on last edited by
                  #25

                  @SGaist i'm so ashamed of my non-acquaintance, but no, I'm not sure.
                  I have installed it with a "mysql-installer-community-5.7.21.0.msi" which I downloaded from official site.
                  How I can figure out that my MySQL library is for MinGW?

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #26

                    You can use Dependency Walker to see if it depends on the Visual Studio runtime.

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #27

                      One other thing to check is whether your library is 32 or 64 bit.

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      C 2 Replies Last reply
                      1
                      • SGaistS SGaist

                        One other thing to check is whether your library is 32 or 64 bit.

                        C Offline
                        C Offline
                        CrowSun
                        wrote on last edited by
                        #28

                        @SGaist I suggest, that I need a 32bit library for mingw?

                        1 Reply Last reply
                        0
                        • SGaistS SGaist

                          One other thing to check is whether your library is 32 or 64 bit.

                          C Offline
                          C Offline
                          CrowSun
                          wrote on last edited by
                          #29

                          @SGaist I uninstalled mySql from my pc and than I downloaded MySql community Server for windows 32bit (btw I have a 64bit windows). Than I unpacked zip archive in a folder without spaces and entered all previous commands in console. And FINALLY it all executed without errors.
                          Thanks to everyone who replied on my topic and thank you SGaist for all answers and patience!

                          C 1 Reply Last reply
                          2
                          • C CrowSun

                            @SGaist I uninstalled mySql from my pc and than I downloaded MySql community Server for windows 32bit (btw I have a 64bit windows). Than I unpacked zip archive in a folder without spaces and entered all previous commands in console. And FINALLY it all executed without errors.
                            Thanks to everyone who replied on my topic and thank you SGaist for all answers and patience!

                            C Offline
                            C Offline
                            cawlfj
                            wrote on last edited by
                            #30

                            @CrowSun
                            Could you give me a details for build mysql for android on windows ?
                            I am using window10 x64 qt5.10.1(vs2015) mysql-connector-c-6.1.11-winx64.zip
                            Could make a one step by step instruction ?
                            Best regards,
                            jeff

                            1 Reply Last reply
                            0
                            • SGaistS SGaist

                              Hi,

                              As an alternative, you can download the 5.7.1 source for Windows from here and check with that one.

                              S Offline
                              S Offline
                              Saad02
                              wrote on last edited by
                              #31

                              @SGaist Sir, this link is not working anymore with the error code 404.

                              SGaistS 1 Reply Last reply
                              0
                              • S Saad02

                                @SGaist Sir, this link is not working anymore with the error code 404.

                                SGaistS Offline
                                SGaistS Offline
                                SGaist
                                Lifetime Qt Champion
                                wrote on last edited by
                                #32

                                @Saad02 which link are you referring to ?

                                Interested in AI ? www.idiap.ch
                                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                S 1 Reply Last reply
                                0
                                • SGaistS SGaist

                                  @Saad02 which link are you referring to ?

                                  S Offline
                                  S Offline
                                  Saad02
                                  wrote on last edited by
                                  #33

                                  @SGaist This one-
                                  http://download.qt.io/official_releases/qt/5.7/5.7.1/single/qt-everywhere-opensource-src-5.7.1.zip
                                  It's in the here quote above.

                                  Actually I have mysql folder but there is CMakeLists instead of qt project file (.pro)
                                  I tried with cmake too. And here is the result-
                                  https://forum.qt.io/topic/146382/how-to-create-qt-6-5-mysql-driver-with-cmake?_=1688809685576

                                  SGaistS 1 Reply Last reply
                                  0
                                  • S Saad02

                                    @SGaist This one-
                                    http://download.qt.io/official_releases/qt/5.7/5.7.1/single/qt-everywhere-opensource-src-5.7.1.zip
                                    It's in the here quote above.

                                    Actually I have mysql folder but there is CMakeLists instead of qt project file (.pro)
                                    I tried with cmake too. And here is the result-
                                    https://forum.qt.io/topic/146382/how-to-create-qt-6-5-mysql-driver-with-cmake?_=1688809685576

                                    SGaistS Offline
                                    SGaistS Offline
                                    SGaist
                                    Lifetime Qt Champion
                                    wrote on last edited by
                                    #34

                                    @Saad02 there was an issue with the archive at some points and this version of Qt is available in a different subfolder.

                                    You seem to be following Qt 6 instructions to build for Qt 5. It won't work as Qt 6 is using cmake and Qt 5 is using qmake.

                                    Interested in AI ? www.idiap.ch
                                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                    1 Reply Last reply
                                    0

                                    • Login

                                    • Login or register to search.
                                    • First post
                                      Last post
                                    0
                                    • Categories
                                    • Recent
                                    • Tags
                                    • Popular
                                    • Users
                                    • Groups
                                    • Search
                                    • Get Qt Extensions
                                    • Unsolved