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. Install lib to mingw
Forum Updated to NodeBB v4.3 + New Features

Install lib to mingw

Scheduled Pinned Locked Moved General and Desktop
8 Posts 2 Posters 2.4k Views 1 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.
  • S Offline
    S Offline
    Salvatello
    wrote on last edited by
    #1

    as you add a .lib?
    I use mingw on windows vista 32 bit.

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Please explain what do you mean? What is the problem and what do you want to achieve?

      (Z(:^

      1 Reply Last reply
      0
      • S Offline
        S Offline
        Salvatello
        wrote on last edited by
        #3

        I have libreria.lib

        I add library - external library - I select libreria.lib - put static

        I created the following code:
        @win32: LIBS += -L$$PWD/../LIBLIBRERIA/debug/ -llibreria

        INCLUDEPATH += $$PWD/../LIBLIBRERIA/debug
        DEPENDPATH += $$PWD/../LIBLIBRERIA/debug

        win32:!win32-g++: PRE_TARGETDEPS += $$PWD/../LIBLIBRERIA/debug/libreria.lib
        else:win32-g++: PRE_TARGETDEPS += $$PWD/../LIBLIBRERIA/debug/liblibreria.a@

        I have two questions at this point:
        liblibreria.a is it?

        if little man liblibreria.a come out these errors:
        undefined reference to imp_zn5……….Ev
        undefined reference to imp_zn5……….Eb
        undefined reference to imp_zn5……….Esb

        what do I do?

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          Looks like the compilation goes well, only the linking fails.

          Please check that the libliberia.a is located in the directory specified in the .pro file. You can also modify the LIBS variable call to point specifically to the libliberia.a file.

          (Z(:^

          1 Reply Last reply
          0
          • S Offline
            S Offline
            Salvatello
            wrote on last edited by
            #5

            no, I liblibreria.a
            I only libreria.lib and libreria.dll;
            liblibreria.a inserts it when I insert library with add library.
            I do not know what liblibreria.a.
            You can explain it to me?

            1 Reply Last reply
            0
            • sierdzioS Offline
              sierdzioS Offline
              sierdzio
              Moderators
              wrote on last edited by
              #6

              OK, I think I got you now.

              You have a static library, ending with .lib, and you want to include it in your project, which uses MinGW. As far as I know, this is not possible. LIB files come from MSVC compiler, which is not compatible with MinGW. MinGW expect .a files.

              You need to either switch to dynamic libaries (DLLs), or get a MinGW build of your Liberia library, or switch to MSVC yourself.

              (Z(:^

              1 Reply Last reply
              0
              • S Offline
                S Offline
                Salvatello
                wrote on last edited by
                #7

                I tried this:
                I downloaded a program (lib2) that converts libreria.lib + libreria.dll in liblibreria.a;

                I post:
                @win32: LIBS += -L$$PWD/../LIBLIBRERIA/debug/ -llibreria

                INCLUDEPATH += $$PWD/../LIBLIBRERIA/debug
                DEPENDPATH += $$PWD/../LIBLIBRERIA/debug

                win32:!win32-g++: PRE_TARGETDEPS += $$PWD/../LIBLIBRERIA/debug/libreria.lib
                else:win32-g++: PRE_TARGETDEPS += $$PWD/../LIBLIBRERIA/debug/liblibreria.a@

                but I leave the following errors:
                undefined reference to imp_zn5……….Ev
                undefined reference to imp_zn5……….Eb
                undefined reference to imp_zn5……….Esb
                ...
                ...
                ...

                one for each function that should be called from libreria.lib or libreria.dll

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  Salvatello
                  wrote on last edited by
                  #8

                  He said the manufacturer of the library.
                  I wrote that is not compatible with mingw.
                  Thanks for the help you have given me.

                  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