0

I have installed 32-bit Qt and have 64 bit compiled binaries for OpenCV2.4.10 (from source). I have two questions:

  1. I built OpenCV libraries before installing Qt. But from what I understand, it is more to use Qt style UI but is not necessary to interface with Qt. Should I rebuild OpenCV?

  2. When I tried 64-bit Qt, it didn't work because OpenCV was compiled with VS 2013 - which is only 32-bit. So I moved over to 32-bit Qt, but it still gives me linker errors of the form: mainwindow.obj : error LNK2019: unresolved external symbol "void __cdecl cv::fastFree(void *)" (?fastFree@cv@@YAXPAX@Z) referenced in function "public: __thiscall cv::Mat::~Mat(void)" (??1Mat@cv@@QAE@XZ) I added the include path and libraries in the .pro file. Am I getting error because Qt is 32-bit and I am using 64-bit OpenCV?

I definitely need to use 64-bit OpenCV. Is there a way I can get Qt to interface with OpenCV? Or any other way to have GUI with C++/OpenCV?

Thanks,

littlie
  • 21
  • 2

1 Answers1

0

If you think about what happens when you press the compile button then you will realise why you cannot have two different architecture sets for your libraries.

When you compile your program in 32 Bit it is coded in a way that a 32 ( a coincidently a 64) bit architecture can understand and run on the underlying hardware.

However 32 bit hardware can definitely not run 64 bit architecture set coded programs, so what happens when you try to include two different binaries into your application? How would visual studio know how to build them together?

It is probably worth having a look at this and this in order to gather a better understanding.

now in answer to:

I definitely need to use 64-bit OpenCV. Is there a way I can get Qt to interface with OpenCV? Or any other way to have GUI with C++/OpenCV?

If it is a certain you need 64bit OpenCV then you are going to have to find a way to use 64Bit Qt or not use Qt. Here is a good guide on how to get it up and running, you need to add some extra features to Visual Studio.

You could of course use QtCreator but if you are more comfortable with Visual Studio it may be worth putting the extra effort in.

Community
  • 1
  • 1
GPPK
  • 6,546
  • 4
  • 32
  • 57