Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Linker issues only in QT Creator using MinGw64
Qt 6.11 is out! See what's new in the release blog

Linker issues only in QT Creator using MinGw64

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
19 Posts 3 Posters 3.4k 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

    MinGW supports both 32 and 64 bits.

    M Offline
    M Offline
    Mr. Calogero
    wrote on last edited by
    #9

    @SGaist Btw, for some reason it cannot link some Microsoft libraries in .lib file

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

      Are these static or dynamic librairies ?
      If the later, did you properly export the symbols of your library ?

      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
      • M Offline
        M Offline
        Mr. Calogero
        wrote on last edited by
        #11

        I tried both static and dynamic libraries.
        I would rather dynamic ones. I have a library that i use in all my softwares and when i compile i can find the .dll file only. I take that and all the headers files and copy them to the project that uses this library, but it cannot resolve symbols because it requires an import library (.lib), so it compiles because it finds all the headers but it does not link and so it fails.

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

          Then the important point: are you properly exporting you libraries symbol ?

          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
          • M Offline
            M Offline
            Mr. Calogero
            wrote on last edited by Mr. Calogero
            #13

            What do you mean? With MinGw i used to simply compile and deploy the library. I setted up the IDE with install argument and all the install paths so it used to export in /dist all the header (copied) and the .a and .dll files, and it used to work like a charm. I don't know how to do it with MSVC neither where to find infos on how to do it. I'm just compiling and getting the .dll (or .lib if i configure for static library) and that's it...I'm probably forgetting something.

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

              See the Creating Shared Library part in Qt's documentation.

              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
              1
              • M Offline
                M Offline
                Mr. Calogero
                wrote on last edited by
                #15

                I've never find such a page.. although i looked for it for a lot.
                I managed to compile my library but it does not work on the client side. It's because i have some classes such:

                class Q_DECL_EXPORT myClass : std::exception
                {
                //blablabla
                }
                

                and so, it doesn't work because while there's not problem with "myClass", base class "exception" of C++ must be "exportable", and it's not.

                How can i export in the dll exporting table a symbol of the C++ system libraries?

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

                  You did not follow the example correctly. You are not supposed to use the two Qt macros directly.

                  Create your own that will use them both like shown in the documentation I linked.

                  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
                  • M Offline
                    M Offline
                    Mr. Calogero
                    wrote on last edited by
                    #17

                    I did everything correctly. I created my own macro and used it, i wrote "Q_DECL_EXPORT" in the example to clarify. I don't even have a class called "myClass" for that matter.

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

                      Symbol exportation does not apply only to classes.

                      Can you show your actual code ?

                      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
                      • M Offline
                        M Offline
                        Mr. Calogero
                        wrote on last edited by
                        #19

                        Thank you, i solved the problem! Now everything works fine, there was an unhandled exception in my code and i thought it was a link issue but it wasn't. The library builds and links with no problem now, thanks again!

                        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