Qt and opencv 3.4 error

  • Hello,
    I was trying to run the opencv program in qt. When i run as a console application it works fine.
    But when i include the above in widget it gives me error as follows:
    dialog.obj:-1: error: LNK2019: unresolved external symbol "void __cdecl cv::fastFree(void *)" (?fastFree@cv@@YAXPEAX@Z) referenced in function "public: __cdecl cv::Mat::~Mat(void)" (??1Mat@cv@@QEAA@XZ)
    dialog.obj:-1: error: LNK2019: unresolved external symbol "private: char * __cdecl cv::String::allocate(unsigned __int64)" (?allocate@String@cv@@AEAAPEAD_K@Z) referenced in function "public: __cdecl cv::String::String(char const *)" (??0String@cv@@QEAA@PEBD@Z)

    I am qt using msvc 64 bit and my qt 64 bit.

    I have also build opencv library on 64-bit visual studio 2017

  • Moderators

    @Kira Do you link your app against opencv libraries?

  • @Kira you may have an issue with the order of OpenCV's libraries and how they linked. You may want to take a look at this example as a guideline of how the libraries show be referred in your .pro file.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.