Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3616754
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T22:32:17+00:00 2026-05-18T22:32:17+00:00

I’ve been trying to use openCV 2.2’s new Qt functions (See http://opencv.willowgarage.com/documentation/cpp/qt_new_functions.html#index-1384 ) for

  • 0

I’ve been trying to use openCV 2.2’s new Qt functions (See http://opencv.willowgarage.com/documentation/cpp/qt_new_functions.html#index-1384) for a project but I keep getting the error:

1> main.cpp 1>main.obj : error
LNK2019: unresolved external symbol
“void __cdecl
cv::displayStatusBar(class
std::basic_string,class
std::allocator > const &,class
std::basic_string,class
std::allocator > const &,int)”
(?displayStatusBar@cv@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@0H@Z)
referenced in function _main
1>C:\Documents and Settings\Orange\my
documents\visual studio
2010\Projects\FYP\FYP.exe : fatal
error LNK1120: 1 unresolved externals

I’m using Visual Studio 2010, windows xp, qt 4.7.1 and openCV 2.2.
I have already added the core lib files for both openCV and qt in my project settings under properties>Linker>Input. I have tried compiling and running openCV code without experiencing any problem except when I tried to use the new Qt functions such as displayStatusBar(…) and createButton(…). I’ve been searching for a solution for a couple of days now and I still could not find one possibly because openCV2.2 was released only recently. Has anyone tried and encountered this problem and have a solution?

Btw the reason I want to use the openCV provided functions for creating simple windows and buttons instead of qt is because I wish to avoid having to convert between the Mat data type in openCV and QImage in Qt.

Thanks in advance to any replies.

Attached code:

#include <cv.h>
#include <highgui.h>

using namespace cv;

int main()
{
    namedWindow("Test", CV_WINDOW_AUTOSIZE);            
    // ...
    // Code links without problem when the following line is commented out.
    displayStatusBar("Test", "Hello World", 5000);  

    return 0;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T22:32:17+00:00Added an answer on May 18, 2026 at 10:32 pm

    I found out the problem so I think I should post an answer here for the benefit of others who may have experienced the same problem.

    Basically the binaries provided for OpenCv 2.2 by default do NOT include the Qt new functions. To enable it, one needs to download the OpenCv source and use CMake to generate makefiles and source that include the Qt new functions and compile the source from scratch.

    Here are roughly the steps to do:

    1. First, install QT using the SDK from here:
      http://qt.nokia.com/downloads/ . NOTE: You will need to add the QT libs and header files to your system path and to your linker path so that your compiler can locate them. It is NOT simply download and install. For windows, see: http://developer.qt.nokia.com/doc/qt-4.8/install-win.html to find out how to add the environment variables. You will need to set them up for CMake to detect QT and generate the proper files. For linux users, see: http://blog.sudobits.com/2010/06/30/how-to-install-qt-on-ubuntu-10-04/
    2. Download and install CMake from here:
      http://cmake.org/cmake/resources/software.html .
    3. Download OpenCV’s source code for your OS from here:
      http://opencv.willowgarage.com/wiki/
    4. Now run the GUI of CMake and use it to select the folder where you
      have extracted the OpenCV source. Select the type of OS you are
      compiling for i.e. Unix Makefiles, Visual Studio solution, XCode
      etc.
    5. Now a list of options should appear. There will be an option for QT
      as well as QT with openGL. Select the first and the one with openGL
      if you require it. Next, click the “configure” button followed by “generate” button in
      CMake. The necessary project files would then be generated.
    6. Depending on the
      type of project you created (Unix Makefiles, Visual Studio project
      etc.), you can now go to the folder where they are generated by
      CMake and compile the project. For e.g. if you chose CMake to
      generate Visual Studio solution, there would be a Visual Studio
      solution file in the folder. Open it and select Build All. If you
      chose Unix Makefiles just call “make” at the command line followed by “sudo make install”.
    7. Now all you need is the libraries in the /lib folder and the header
      files in the /include folder. Copy this 2 folders to whereever you
      wish to place them. For e.g. on Ubuntu, after you have typed “sudo make
      install” they would have been automatically copied to /usr/local/lib
      and /usr/local/include. For windows user, they would be in the
      folder you specified in CMake.
    8. To link your project (be it visual studio or using make in unix),
      you have to tell your linker where to find the libs and include
      files. You specify them as you would when you downloaded the OpenCV
      binaries.

    Thats it. You should now have a working OpenCV with QT.

    Instructions on how to compile from scratch is given on OpenCv’s webpage here: http://opencv.willowgarage.com/wiki/InstallGuide.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a jquery bug and I've been looking for hours now, I can't
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am trying to loop through a bunch of documents I have to put
I'm looking for suggestions for debugging... If you view this site in Firefox or
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
That's pretty much it. I'm using Nokogiri to scrape a web page what has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.