Install lib to mingw



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


  • Moderators

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



  • 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?


  • Moderators

    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.



  • 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?


  • Moderators

    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.



  • 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



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


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.