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. Undefined reference to _imp__zn5..........Ev
Forum Updated to NodeBB v4.3 + New Features

Undefined reference to _imp__zn5..........Ev

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 2.0k 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

    I have a project like that:
    main.cpp
    Libreria.h
    provaLibreria.pro

    I run the project, and I have these errors:

    undefined reference to _imp__zn5..........Ev
    undefined reference to _imp__zn5..........Eb
    undefined reference to _imp__zn5..........sb
    ..
    ..

    an error for each function declared in libreria.h
    I know that I need to add an external library
    libreria.lib

    I do it this way:
    @win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../LIBLIBRERIA/release/ -lLibreria
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../LIBLIBRERIA/debug/ -lLibreria
    else:unix: LIBS += -L$$PWD/../LIBLIBRERIA/ -lLibreria

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

    win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/../LIBLIBRERIA/release/libreria.a
    else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/../LIBLIBRERIA/debug/libreria.a
    else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/../LIBLIBRERIA/release/libreria.lib
    else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/../LIBLIBRERIA/debug/libreria.lib
    else:unix: PRE_TARGETDEPS += $$PWD/../LIBLIBRERIA/libreria.a@

    comes this error:
    no rule to make taarget '....../..../..../libreria.a', needed by 'debug\provaLibreria.exe'. Stop.

    What does this error?
    where it exits out the file libreria.a?

    1 Reply Last reply
    0
    • H Offline
      H Offline
      hsierra00
      wrote on last edited by
      #2

      Hi
      Generally this error is associate with linked error. If you use signal and slot mechanism remember inherent by QObject and include
      QT += core

      and in your header (.h) put
      Q_OBJECT

      please put more information of the problem...

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

        Q_OBJECT is not the problem.

        I try to explain better:
        I have a cpp file and a class in salvatello libreria.h
        I salvatello * g.
        then g-> function_name.
        libreria.h also uses libreria.lib.

        if not iserisco library come out these errors:
        undefined reference to imp_zn5……….Ev
        undefined reference to imp_zn5……….Eb
        undefined reference to imp_zn5……….sb

        I suppose they are linked to the fact that I do not add the libreria.lib

        I then add static library-and I added this code:
        @win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../LIBLIBRERIA/release/ -lLibreria
        else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../LIBLIBRERIA/debug/ -lLibreria
        else:unix: LIBS += -L$$PWD/../LIBLIBRERIA/ -lLibreria

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

        win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/../LIBLIBRERIA/release/libreria.a
        else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/../LIBLIBRERIA/debug/libreria.a
        else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/../LIBLIBRERIA/release/libreria.lib
        else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/../LIBLIBRERIA/debug/libreria.lib
        else:unix: PRE_TARGETDEPS += $$PWD/../LIBLIBRERIA/libreria.a@

        comes this error:
        no rule to make taarget ‘……/…./…./libreria.a’, needed by ‘debug\provaLibreria.exe’. Stop.

        libreria.a is it?
        I do not understand what this means error

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

          Hi,

          Maybe a silly question but does libreria.a exists ?

          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
          • S Offline
            S Offline
            Salvatello
            wrote on last edited by
            #5

            no does not exist. I only libreria.lib.
            if I make the automatic insertion of the external library, I select libreria.lib, and I generate that code. Libreria.a not know where to come out.

            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