Qt World Summit: Submit your Presentation

[Solved] is opencv/Qt installation stable? slash directions make no difference still compiles

  • I installed a simple app 'Lena " Qt/OpenCV and it executes successfully. However it appears that the backslash/forward slash in the includepath is virtually ignored "/", "//", "\" or "\ " in the pro.file. Either way with the slashes, it works. Is this normal behavior? From the evidence can I conclude whether the build is stable or not?

    .PRO file
    QT       += core
    QT       -= gui
    TARGET = Lena
    CONFIG   += console
    CONFIG   -= app_bundle
    TEMPLATE = app
    INCLUDEPATH += C:/opencv-win/opencv/sources/modules/core/include \
    #INCLUDEPATH += C:\\opencv-win\\opencv\\sources\\modules\\highgui\\include \
    #INCLUDEPATH += C:\\opencv-win\\opencv\\sources\\modules\\imgproc\\include
    #INCLUDEPATH += C://OpenCV2.2//include\
    LIBS +=-LC:\\OpenCV-2.3.1\\include
    LIBS +=-LC:\\OpenCV-2.3.1\\bin\
        -lopencv_core2411 -lopencv_highgui2411 -lopencv_imgproc2411 -lopencv_video2411
    SOURCES += main.cpp
    #include "iostream"
    #include <opencv2/core/core.hpp>
    #include <opencv2/highgui/highgui.hpp>
    #include <opencv2/imgproc/imgproc.hpp>
    using namespace cv;
    using namespace std;
    int main()
        IplImage *image = cvLoadImage("C:\\lena.jpg");
        Mat im(image);
        return 0;
      ```                                ^

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    When using Qt you can simplify things and just use the Unix forward slash notation even on Windows

  • Thx, problem resolved. Consider it closed.

Log in to reply