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 8248071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T23:04:23+00:00 2026-06-07T23:04:23+00:00

I would like to link against OpenCV library (debian squeeze package) in my Qt

  • 0

I would like to link against OpenCV library (debian squeeze package) in my Qt project. The project is a plain C++ project using no Qt libraries, it just uses Qt build system (qmake). to generate MakeFile.

I think OpenCV library in of package is compiled both statically and dynamic, because there are .so objects and .a objects in /usr/lib. I’m looking for linkage options of Qt project file to tell the build system to look for static libraries. I’ve also tried adding LIBS+= -static -lcv ,... but didn’t work.

  • 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-06-07T23:04:26+00:00Added an answer on June 7, 2026 at 11:04 pm

    I had lots of problems trying to deploy a project that used OpenCV and QT. Static linking ended up being a horrible rabbit hole that maybe i was not clever enough to figure out, but we came up with what I feel to be a better alternative. check it out if interested. It involves the craziest command I have ever seen written 🙂

    Statically compiling a project that uses many independent libraries can be prohibitively tricky. There can also be weird legal problems with building other libraries into your binary if they are not GPL’ed. Instead we found a simpler method for sharing a binary and its dependencies in one neat little package.

    First build a normal release binary as if you were just normally developing
    Next go into this release directory and run this command. It will copy every dependency needed by the binary to the folder of your choice!

    cp `ldd NAMEOFYOURRELEASE | sed -re s/^.+\=\>// | sed -re 's/^(.+) \(.+\)/\1/'` FOLDERNAMETOPUTLIBRARIES/
    

    for NAMEOFYOURRELEASE put the name of the executeable binary file that you created,

    and for FOLDERNAMETOPUTLIBRARIES put the name of a folder that you would wish to copy all the dependencies into
    3. Now we need to tell the executable where to look for the dependencies when it is on a strange new computer.
    Go into your .pro file for your project and add these two lines

    QMAKE_LFLAGS += -Wl,--rpath=\\\$\$ORIGIN/FOLDERNAMETOPUTLIBRARIES
    QMAKE_LFLAGS_RPATH=
    

    Now you should be able to move this binary and its folder of dependencies wherever you want!

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

Sidebar

Related Questions

I would like to link to a specific section of a report from another
I've recently started developing a portfolio website which I would like to link to
I would like to keep first link as default selected with javascript, here is
I would like to track the link that a user followed to reach my
I would like to construct an HTML link element referencing a CSS file and
I would like to change the target of symbolic link from within a bash
I would like to know how the recycle image link works, it points to
I would like to add track code for each link of in my email
I have a href link and I would like it to be clicked when
I am developing a new project, using Autotools for my build infrastructure. I would

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.