Results 1 to 3 of 3

Thread: Compiling Error, OpenCV: cv.h: No such file or directory

  1. #1
    Join Date
    Apr 2007
    Beans
    13

    Compiling Error, OpenCV: cv.h: No such file or directory

    I'm attempting to complie some code written in c++

    Code:
    g++ codename.cpp -o codename
    However, when I try compiling I get the error:

    Code:
    codename.cpp:4:16: fatal error: cv.h: No such file or directory
    Can someone shed on light on what this error means?

  2. #2
    Join Date
    Jun 2013
    Beans
    11

    Re: Compiling Error, OpenCV: cv.h: No such file or directory

    It seems that the compiler cannot find the header file with the name cv.h called in the fourth line of your code.

  3. #3
    Join Date
    Apr 2012
    Beans
    6,903

    Re: Compiling Error, OpenCV: cv.h: No such file or directory

    It's part of the older C API I think - you need libcv-dev as well as libopencv-dev, then you need to give the include path - easiest way is via pkg-config

    Code:
    g++ `pkg-config --cflags opencv` codename.cpp -o codename
    Likewise you will need to tell the linker where to find the actual libs

    Code:
    g++ `pkg-config --cflags opencv` codename.cpp `pkg-config --libs opencv` -o codename

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
  •