I have a QT/Opencv project that worked great with Visual Studio 2015 and Qt 5.6. Since I bought a new pc, I installed Visual Studio 2017 and the new Qt 5.9. If I try to import the project and to compile it, I get a huge list of LNK2019
and LNK2001
errors on Opencv calls. I've already checked that QT founds the correct compile and the platform is right (x64), and also checked that the Opencv includes are correctly found.
Which other checks I should do?
I'm using Windows 10, Qt Creator 4.4.1 and Visual Studio 2017 Community.
As @DimChtz and @drescherjm said in comments, the problem was the .lib linking. In the previous version of QT, I linked the library in this way: LIBS += -L"path/opencv_world331.lib"
. In order to make it work, I just removed the -L
parameter.
The EASIEST and most SIMPLE method of ensuring your OpenCV libraries (all external libraries) are linked with Qt is to use the "Add Library..." option.
The steps listed below are found in the Qt5 documentation: [ http://doc.qt.io/qtcreator/creator-project-qmake-libraries.html][1] under the "To Add Library" section.
Let me add some specificity from here...
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.