QMake – how to copy a file to the output

You can use a qmake function for reusability: # Copies the given files to the destination directory defineTest(copyToDestdir) { files = $$1 for(FILE, files) { DDIR = $$DESTDIR # Replace slashes in paths with backslashes for Windows win32:FILE ~= s,/,\\,g win32:DDIR ~= s,/,\\,g QMAKE_POST_LINK += $$QMAKE_COPY $$quote($$FILE) $$quote($$DDIR) $$escape_expand(\\n\\t) } export(QMAKE_POST_LINK) } then use it … Read more

How to add include path in Qt Creator?

If you are using qmake, the standard Qt build system, just add a line to the .pro file as documented in the qmake Variable Reference: INCLUDEPATH += <your path> If you are using your own build system, you create a project by selecting “Import of Makefile-based project”. This will create some files in your project … Read more

How to link opencv in QtCreator and use Qt library

Finally I am starting to be happy. When adjusting this question I had to try all the ways how to define LIBS. Listing them manually helped, at first I wrote them somehow wrong. This is how it works finally: LIBS += -LC:\\Programs\\opencv24\\opencv_bin2\\bin \ libopencv_core240d \ libopencv_highgui240d \ libopencv_imgproc240d \ libopencv_features2d240d \ libopencv_calib3d240d \