Using QMake to compile a Visual Studio project which uses QT5 & OpenCV libraries



  • Hello,
    I must admit i am relatively new to QMake and CMake. I have built a OpenCV project in Visual Studio 2015 which uses QT libraries for GUI. The project is running perfectly fine.

    But i want to run this project on a ARM board (ODROID XU3, Ubuntu 14.04). I have compiled OpenCV libraries on the board but no Qt creator because of space limitations. How can i use QMake to build this project on this board without writing a single line of code?

    I did research about writing QMake files but didn't find much about linking OpenCV libraries to it.

    Please help! I need this for my project.


  • Lifetime Qt Champion

    Hi,

    For qmake you can use something like:

    INCLUDEPATH += /path/to/OpenCV/include/folder
    
    LIBS += -L/path/to/OpenCV/lib/folder \ 
                -lopencv_coreXXX \
                -lopencv_imgprocXXX \
                -lopencv_highguiXXX \
                # next OpenCV libs you need
    

    Note that you can also setup your project on your Windows machine using either qmake or cmake and once it's building there, bring it over to your Linux target, and add the Linux specific pieces to link to OpenCV



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