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 -llibmysqld Collect2.exe: error: ld returned 1 exit status
Forum Updated to NodeBB v4.3 + New Features

Cannot find -llibmysqld Collect2.exe: error: ld returned 1 exit status

Scheduled Pinned Locked Moved Solved General and Desktop
12 Posts 3 Posters 2.1k Views
  • 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.
  • M Offline
    M Offline
    Malibob
    wrote on 28 May 2020, 20:12 last edited by Malibob
    #1

    When i was running qt application, it gives these issues. Compile output screenshot is here.dl.JPG
    I'm using Qt\5.15.0, mingw81_32, MySQL Connector C 6.1. Anyone have idea about this?

    1 Reply Last reply
    0
    • B Offline
      B Offline
      Bonnie
      wrote on 28 May 2020, 21:16 last edited by Bonnie
      #2

      You're trying to link libmysqld, the debug version of libmysql, but MySQL Connector C don't have that.
      And from your output, it looks like you're not linking from MySQL Connector C, but MySQL Server 8.0.
      What do you write for LIBS in the .pro file?
      And what .libs are in C:\Program Files\MySQL\MySQL Server 8.0\lib?
      Also, why are you linking libmysql? If you are using the mysql plugin of Qt sql drivers, there's no need to do that.

      M 1 Reply Last reply 28 May 2020, 21:35
      0
      • B Bonnie
        28 May 2020, 21:16

        You're trying to link libmysqld, the debug version of libmysql, but MySQL Connector C don't have that.
        And from your output, it looks like you're not linking from MySQL Connector C, but MySQL Server 8.0.
        What do you write for LIBS in the .pro file?
        And what .libs are in C:\Program Files\MySQL\MySQL Server 8.0\lib?
        Also, why are you linking libmysql? If you are using the mysql plugin of Qt sql drivers, there's no need to do that.

        M Offline
        M Offline
        Malibob
        wrote on 28 May 2020, 21:35 last edited by Malibob
        #3

        @Bonnie So what can I do? install MySQL Server 8.0. and make PATH for it? i didn't link it with MySQL Server 8.0. How can i solve this?

        B 1 Reply Last reply 28 May 2020, 21:45
        0
        • M Malibob
          28 May 2020, 21:35

          @Bonnie So what can I do? install MySQL Server 8.0. and make PATH for it? i didn't link it with MySQL Server 8.0. How can i solve this?

          B Offline
          B Offline
          Bonnie
          wrote on 28 May 2020, 21:45 last edited by Bonnie
          #4

          @Malibob I'm not sure because I don't know what you've done. Can you post you .pro file?
          And tell me do you have this C:\Program Files\MySQL\MySQL Server 8.0\lib folder in your system?
          And if yes, what .libs are in it?

          M 1 Reply Last reply 28 May 2020, 21:50
          0
          • B Bonnie
            28 May 2020, 21:45

            @Malibob I'm not sure because I don't know what you've done. Can you post you .pro file?
            And tell me do you have this C:\Program Files\MySQL\MySQL Server 8.0\lib folder in your system?
            And if yes, what .libs are in it?

            M Offline
            M Offline
            Malibob
            wrote on 28 May 2020, 21:50 last edited by
            #5

            @Bonnie Just I want to connect with MySQL database. There is no C:\Program Files\MySQL\MySQL Server 8.0\lib folder.

            B 1 Reply Last reply 28 May 2020, 21:52
            0
            • M Malibob
              28 May 2020, 21:50

              @Bonnie Just I want to connect with MySQL database. There is no C:\Program Files\MySQL\MySQL Server 8.0\lib folder.

              B Offline
              B Offline
              Bonnie
              wrote on 28 May 2020, 21:52 last edited by Bonnie
              #6

              @Malibob Do you want to connect it by Qt Sql driver plugin, or you want to connect by your own using functions from "mysql.h"?
              And I really need your .pro file to understand the situation, just the LIBS-related part.

              M 1 Reply Last reply 28 May 2020, 22:01
              0
              • B Bonnie
                28 May 2020, 21:52

                @Malibob Do you want to connect it by Qt Sql driver plugin, or you want to connect by your own using functions from "mysql.h"?
                And I really need your .pro file to understand the situation, just the LIBS-related part.

                M Offline
                M Offline
                Malibob
                wrote on 28 May 2020, 22:01 last edited by
                #7

                @Bonnie I want to connect it by Qt SQL driver plugin. Sorry for the late reply. I Can make a message within 10 minutes

                B 1 Reply Last reply 28 May 2020, 22:10
                0
                • M Malibob
                  28 May 2020, 22:01

                  @Bonnie I want to connect it by Qt SQL driver plugin. Sorry for the late reply. I Can make a message within 10 minutes

                  B Offline
                  B Offline
                  Bonnie
                  wrote on 28 May 2020, 22:10 last edited by
                  #8

                  @Malibob Then you don't need to link libmysql at all.
                  Since you still not post your .pro file, I can only tell you to remove all the mysql-related contents from LIBS.

                  M 1 Reply Last reply 28 May 2020, 22:13
                  1
                  • B Bonnie
                    28 May 2020, 22:10

                    @Malibob Then you don't need to link libmysql at all.
                    Since you still not post your .pro file, I can only tell you to remove all the mysql-related contents from LIBS.

                    M Offline
                    M Offline
                    Malibob
                    wrote on 28 May 2020, 22:13 last edited by Malibob
                    #9

                    @Bonnie qt1.JPG qt2.JPG

                    B 1 Reply Last reply 28 May 2020, 22:20
                    0
                    • M Malibob
                      28 May 2020, 22:13

                      @Bonnie qt1.JPG qt2.JPG

                      B Offline
                      B Offline
                      Bonnie
                      wrote on 28 May 2020, 22:20 last edited by Bonnie
                      #10

                      @Malibob Yeah, you need to delete all the lines from line 45 to the end.

                      M 1 Reply Last reply 28 May 2020, 22:27
                      0
                      • B Bonnie
                        28 May 2020, 22:20

                        @Malibob Yeah, you need to delete all the lines from line 45 to the end.

                        M Offline
                        M Offline
                        Malibob
                        wrote on 28 May 2020, 22:27 last edited by
                        #11

                        @Bonnie Thanks man. It's Solved. I 'm try to make, correct this within last 3 days

                        J 1 Reply Last reply 29 May 2020, 05:00
                        0
                        • M Malibob
                          28 May 2020, 22:27

                          @Bonnie Thanks man. It's Solved. I 'm try to make, correct this within last 3 days

                          J Offline
                          J Offline
                          jsulm
                          Lifetime Qt Champion
                          wrote on 29 May 2020, 05:00 last edited by
                          #12

                          @Malibob Just a note: when using -l do remove the lib prefix. Like

                          LIBS += -lmysql
                          

                          https://forum.qt.io/topic/113070/qt-code-of-conduct

                          1 Reply Last reply
                          1

                          7/12

                          28 May 2020, 22:01

                          • Login

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