Results 1 to 3 of 3

Thread: Build Opencv 3.2 code in Qt Creator4.3.1 with MSVC2015 64bit compiler .

  1. #1
    Join Date
    Aug 2017
    Posts
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default Build Opencv 3.2 code in Qt Creator4.3.1 with MSVC2015 64bit compiler .

    I downloaded Qt creator community and Opencv 3.2

    I created new project and built release version with MSVC2015 64bit compiler . (it works fine)

    I added to .pro file (Opencv library include&libs):

    INCLUDEPATH += -L"C:\\.......\\prebuilt\\include\\opencv2"

    CONFIG(release ,debug|release)
    {
    LIBS += -l"C:\\........ \\prebuilt\x64\vc14\lib"
    LIBS += opencv_world320

    }


    I included :
    #include <opencv2/imgproc.hpp> in mainWindow.h

    When I build I get this error :

    fatal error C1083: Cannot open include file: 'opencv2/imgproc.hpp': No such file or directory
    cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -O2 -MD -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -EHsc -DUNICODE -DWIN32 -DWIN64 -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DNDEBUG -I..\untitled -I. -Il-C:\Users\lenovo\Documents\prebuilt\include -I..\..\..\..\Qt\5.9.1\msvc2015_64\include -I..\..\..\..\Qt\5.9.1\msvc2015_64\include\QtWidget s -I..\..\..\..\Qt\5.9.1\msvc2015_64\include\QtGui -I..\..\..\..\Qt\5.9.1\msvc2015_64\include\QtANGLE -I..\..\..\..\Qt\5.9.1\msvc2015_64\include\QtCore -Irelease -I. -I..\..\..\..\Qt\5.9.1\msvc2015_64\mkspecs\win32-msvc -Forelease\ @C:\Users\lenovo\AppData\Local\Temp\moc_mainwindow .obj.4632.500.jom
    moc_mainwindow.cpp


    What I am doing wrong ?

    Thank you .

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Build Opencv 3.2 code in Qt Creator4.3.1 with MSVC2015 64bit compiler .

    You are using the wrong include flag.
    You are using -L (which is for search library directory).
    You should use -I (that is a capital i)
    INCLUDEPATH += -I"C:\\.......\\prebuilt\\include\\opencv2"
    And vice versa for the libraries:
    LIBS += -L"C:\\........ \\prebuilt\x64\vc14\lib" <<--- -L instead of -I
    LIBS += -lopencv_world320.lib <<--- note the changes, you have to add a -l (that is a lower case L) and I think you need to add the *.lib extension too.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,236
    Thanks
    303
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Build Opencv 3.2 code in Qt Creator4.3.1 with MSVC2015 64bit compiler .

    #include <opencv2/imgproc.hpp> in mainWindow.h
    To add to what high_flyer said, if this is how you are including the opencv2 header files, then your -I directive needs to end with the "include" path, not "include\\opencv2".
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. Replies: 6
    Last Post: 6th December 2017, 14:17
  2. Replies: 2
    Last Post: 9th December 2016, 09:42
  3. OpenCV 2.3 64bit Libraries Don't work on Nokia QT
    By Aerowrx in forum Installation and Deployment
    Replies: 0
    Last Post: 22nd February 2012, 23:52
  4. Build 64bit Qt on 32bit XP
    By photo_tom in forum Installation and Deployment
    Replies: 2
    Last Post: 2nd March 2011, 09:28
  5. help - need to build Qt libraries on 64Bit VS2008
    By caius9090 in forum Installation and Deployment
    Replies: 2
    Last Post: 15th November 2010, 21:18

Tags for this Thread

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.