Reputation: 31
I have been trying to build OpenCV with Qt support in addition to Cuda support lately. Previously I had built OpenCV with Cuda successfully and quite easily but Qt does not seem to be as easy to wrangle into place. I've built it along with Cuda using OpenCV version 4.5.2 so I tried doing the same with Qt but ran into an error similar to this issue.
So next I tried using the newest version where this issue was allegedly solved, cloned master branch and ran into a myriad of issues having no idea where to even start thinking about them (all related to stdio.h; weird basic errors such as syntax errors in alleged stdio.h).
Decided to give up on that and try 4.5.2 again, I could get OpenCV itself to build (not enabling Cuda or Qt just to see if it'd work) and OpenCV with Cuda to build but while running cmake's build all Qt produces the following error
LNK2019 unresolved external symbol "int __cdecl cv::pollKey(void)" (?pollKey@cv@@YAHXZ) referenced in function "struct _object * __cdecl pyopencv_cv_pollKey(struct _object *,struct _object *,struct _object *)" (?pyopencv_cv_pollKey@@YAPEAU_object@@PEAU1@00@Z) \build\modules\python3\cv2.obj
I have been unable to find any relevant info on this, I have run into some posts regarding this error from people including bits of OpenCV in their projects and not including the necessary libraries and alike but none from trying to build the thing itself.
I have also thought to replace the file which resolved issue mentioned above in my 4.5.2 version since the change did not seem to be large and that has solved the issue I previously had with 4.5.2 and Qt. Another thing I tried was to install Qt on it's own and try using that as the qt5dir in cmake but that has not worked either (opposed to qt installed over pip).
At this point I'm at the end of my rope, I don't know what more to try or where to turn, hopefully someone will have had some experience with it already. Here are some bits and pieces of hopefully relevant info:
In closing I'd like to say I've never before dealt with cmake or building any binaries of any sort so this is very much my first meet with such a world
Upvotes: 1
Views: 448
Reputation: 56
set HAVE_WIN32UI=, Apparently, enable HAVE_QT & the above flag together causes some issues in the build due to compile time exclusions. Assuming your use case does not require the above flag. I had the same issue and it's resolved now.
Upvotes: 2