Results 1 to 8 of 8

Thread: Static OpenCV and undefined reference to symbol

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2010
    Location
    Italia
    Posts
    149
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanked 2 Times in 2 Posts

    Default Re: Static OpenCV and undefined reference to symbol

    In my opinion, it's correct as you put in the .pro file, ie inserting the list of static libraries used in the project. You need to better control the project files instead. I've seen in the Qt documentation that you need to insert the right macros to recognize that the project wants the OpenCV static libraries. So make sure that the OpenCV libraries you use are actually the static ones.

  2. #2
    Join Date
    Apr 2010
    Location
    Italia
    Posts
    149
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanked 2 Times in 2 Posts

    Default Re: Static OpenCV and undefined reference to symbol

    I don't know if the idea can solve your problem, but if you are developing directly using the Qt Creator ide, then try to open the .pro project file and in a free point of the file press the right mouse button so that it appears a pop-up menu and click on the "Add Library" item. In the dialog that appears click on the "External Library" option. In the new window select the type of library you want to insert (in your case Statica) and also on which platform you are using (I suppose Windows, so you have to deselect Linux and Mac) and then pressing the "Browse..." buttons go to the path of the directory where your OpenCV static libraries are and the path where the OpenCV include file is. Then press the "Next" button and confirm by pressing the "Finish" button. The lines for inserting static libraries and their path will appear in your .pro file. At this point, the compilation should be successful.

  3. #3
    Join Date
    Mar 2016
    Posts
    22
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Static OpenCV and undefined reference to symbol

    In this project I used different static libs, as cryptopp and others, so I'm quite sure my .pro file includes the right macros. I had already tried to do what giorgik suggested, but the result was the same. By now, I'm using the shared opencv library, to avoid spending too much time, and after the end of the project, I'll return to face this matter.
    Thanks to everyone!

Similar Threads

  1. Static timer attribute - undefined reference error
    By Leutzig in forum General Programming
    Replies: 1
    Last Post: 9th May 2016, 12:51
  2. Undefined reference to qt-Lib after compiling qt static for amv7 under windows
    By michael_endres in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 23rd January 2014, 17:15
  3. Replies: 2
    Last Post: 11th August 2012, 17:37
  4. Replies: 0
    Last Post: 10th May 2011, 14:58
  5. Undefined reference in static binding in Linux
    By gcubar in forum Installation and Deployment
    Replies: 9
    Last Post: 28th February 2011, 15:20

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.