Undefined reference to _imp__zn5..........Ev
-
I have a project like that:
main.cpp
Libreria.h
provaLibreria.proI 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.libI 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/ -lLibreriaINCLUDEPATH += $$PWD/../LIBLIBRERIA/debug
DEPENDPATH += $$PWD/../LIBLIBRERIA/debugwin32-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? -
Hi
Generally this error is associate with linked error. If you use signal and slot mechanism remember inherent by QObject and include
QT += coreand in your header (.h) put
Q_OBJECTplease put more information of the problem...
-
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……….sbI 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/ -lLibreriaINCLUDEPATH += $$PWD/../LIBLIBRERIA/debug
DEPENDPATH += $$PWD/../LIBLIBRERIA/debugwin32-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 -
Hi,
Maybe a silly question but does libreria.a exists ?
-
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.