error LNK2001: unresolved external symbol "public: static struct QMetaObject .. from lib template
-
Hi, do you have a moc_VideoPreviewWidget.cpp that's compiled using Qt 5.12? (The one in the link is built with Qt 5.9.1)
@hskoglund yes of course : https://we.tl/t-Uhhsre7Vzm
the problem is the same with version 5.9.1 or 5.12 (and also VS2017 or VS2015)
-
Hi, if you look in the .pro files above for your application and myStream.lib, both .pro files have a inputstreampreview.cpp and a inputstreampreview.h included. They are not located in the same directory (one pair is in ../../src/ and the other pair is in ../../src/view/) but if they have the same contents then maybe the linker gets confused when you build your app (together with your myStream.lib).
If they do not have the same contents (i.e. just a stroke of bad luck with the naming of your files) then rename one of the pairs. Otherwise, you could try building your app again but with only of the pairs, for example commenting out ../../src/view/inputstreampreview.cpp from the SOURCES section in your Application.pro file.
-
Hi, if you look in the .pro files above for your application and myStream.lib, both .pro files have a inputstreampreview.cpp and a inputstreampreview.h included. They are not located in the same directory (one pair is in ../../src/ and the other pair is in ../../src/view/) but if they have the same contents then maybe the linker gets confused when you build your app (together with your myStream.lib).
If they do not have the same contents (i.e. just a stroke of bad luck with the naming of your files) then rename one of the pairs. Otherwise, you could try building your app again but with only of the pairs, for example commenting out ../../src/view/inputstreampreview.cpp from the SOURCES section in your Application.pro file.
@hskoglund said in error LNK2001: unresolved external symbol "public: static struct QMetaObject .. from lib template:
inputstreampreview.cpp
thanks for your answer, but I don't understand well what you want to say.
inputstreampreview.cpp/.h are only included in myStream.lib (in src folder).
For my main app, I just include the .h with INCLUDEPATH keyword and link myStream lib with LIBS+= -lmyStream
I don't know why and where you can see ../../src/view/ path ?? -
Even if you run qmake and rebuild AppTest.exe i.e. Application.pro?
-
@hskoglund said in error LNK2001: unresolved external symbol "public: static struct QMetaObject .. from lib template:
inputstreampreview.cpp
thanks for your answer, but I don't understand well what you want to say.
inputstreampreview.cpp/.h are only included in myStream.lib (in src folder).
For my main app, I just include the .h with INCLUDEPATH keyword and link myStream lib with LIBS+= -lmyStream
I don't know why and where you can see ../../src/view/ path ??I'm pretty sure at this point that for whatever reason your static library didn't include the symbol in question. One way or another you need to find why that happened. It may be a bug with the library, or some misconfiguration.