undefined reference to _imp_
-
Dear Forum,
I know that there are forum posts with similar topics but I did not found a solution so far.
I have an external .lib to include to my project. I am using MinGW 64bit and Qt 5.15.0
I used the function "Add Library", selected external and selected the .lib.unix:!macx|win32: LIBS += -L$$PWD/./ -llibe9u_LSMD_x64 INCLUDEPATH += $$PWD/. DEPENDPATH += $$PWD/.Now I get multiple "undefinde reference to imp" errors. The supplier of the lib says that it was created using a cross compiler.
I found this:
https://stackoverflow.com/questions/30767553/undefined-reference-when-using-c11-qmake-flagsAnd added:
QMAKE_CXXFLAGS += -std=c++11 CONFIG += c++11But that did not help.
The lib works with Visual Studio. I also tried Qt VS Tools, but that also generated LNK2019 errors.
Any help appreciated.
Thanks!
Dan -
Dear Forum,
I know that there are forum posts with similar topics but I did not found a solution so far.
I have an external .lib to include to my project. I am using MinGW 64bit and Qt 5.15.0
I used the function "Add Library", selected external and selected the .lib.unix:!macx|win32: LIBS += -L$$PWD/./ -llibe9u_LSMD_x64 INCLUDEPATH += $$PWD/. DEPENDPATH += $$PWD/.Now I get multiple "undefinde reference to imp" errors. The supplier of the lib says that it was created using a cross compiler.
I found this:
https://stackoverflow.com/questions/30767553/undefined-reference-when-using-c11-qmake-flagsAnd added:
QMAKE_CXXFLAGS += -std=c++11 CONFIG += c++11But that did not help.
The lib works with Visual Studio. I also tried Qt VS Tools, but that also generated LNK2019 errors.
Any help appreciated.
Thanks!
Dan -
Hi JonB,
the problem was, that some .h were written in C, so this problem was solved by
extern "C" { #include... }This error message is incredible unspecific...
Shouldn't a C or C++ compiler be able to recognize this?cheers,
Dan@dansab said in undefined reference to _imp_:
Shouldn't a C or C++ compiler be able to recognize this?
How? You told the compiler that you're using a c++ function, but the library only exported the c name - how should a linker (not compiler btw) know about this - these are two different symbols for them.