compiling code with opencv - /usr/bin/ld: cannot find -lippicv

前端 未结 5 922
执笔经年
执笔经年 2020-12-16 21:56

When compiling some code with opencv I get this error

# g++ txtbin-03.1.cpp -o txtbin `pkg-config opencv --cflags --libs`
/usr/bin/ld: cannot fi         


        
相关标签:
5条回答
  • 2020-12-16 22:35

    libippicv.a is a third party library, so you need to explicitly provide it during compilation or make it part of your execution environment.

    It is located in ~/OpenCV/opencv-3.1.0/3rdparty/ippicv/unpack/ippicv_lnx/lib/intel64/

    Also, provide cmake -DWITH_IPP=ON at the time of Makefile generation.

    0 讨论(0)
  • 2020-12-16 22:36

    In my case, all it took was to copy libippicv.a from the OpenCV SDK to /usr/local/lib:

    sudo cp 3rdparty/ippicv/unpack/ippicv_lnx/lib/intel64/libippicv.a /usr/local/lib/
    
    0 讨论(0)
  • 2020-12-16 22:38

    I was running into the same problem while trying to install the opencv_contrib repository (opencv-3.1.0/Ubuntu 16.04), and none of the solutions worked (I tried to make OpenCV with flag WITH_IPP=ON, but somehow OpenCV 3.1.0 failed to download the ippicv library(?) and there was no error prompt so I only figured this out when I tried to locate ippicv in terminal).

    My solution was to download another OpenCV build (3.0.0 worked for me), make + make install with flag WITH_IPP=ON, and then copy the downloaded ippicv library (which should be located in /usr/local/share/OpenCV/3rdparty/lib/libippicv.a by now) to /usr/local/lib/.

    I don't know if this is a known bug in OpenCV 3.1.0, but this one is definitely worth keeping an eye out for.

    0 讨论(0)
  • 2020-12-16 22:49

    Recompile OpenCv using following option:

    cmake -DWITH_IPP=ON . && make -j $(nproc) && make install
    
    0 讨论(0)
  • 2020-12-16 22:56

    Recompiling whole library isn't necessary, especially if you don't need this library. I found great and instantly working solution here. In case link expired or broke:

    The solution is simply to remove -lippicv from opencv pkg-config configuration file. So you have to locate opencv.pc file, which default is in /usr/local/lib/pkgconfig/ directory. Then from section Libs: just remove aforementioned library.

    0 讨论(0)
提交回复
热议问题