-
Notifications
You must be signed in to change notification settings - Fork 18.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
problem.. /usr/bin/ld: cannot find -lopencv_imgcodecs #4942
Comments
|
seems like @Mjgo was using opencv2.4 My error message
My setting in Makefile
My Makefile.config
|
From https://github.com/BVLC/caffe/blob/master/CONTRIBUTING.md:
|
@Mjgo @abuccts @Po-Hsuan-Huang Did you already fixed the problem? I got the same problem.... |
comment this line OPENCV_VERSION := 3 will be ok. |
I have the same error. I've included the mentioned libraries in Makefile.config and Makefile. Any solution would be appreciated. |
I have the same error "/usr/bin/ld: cannot find -lopencv_imgcodecs I have Opencv 3.3 |
I have the same problem: |
Has anybody figured out how to fix this issue!? |
I tried but I wasn't able to figure out how to fix it and I asked this question on Caffe Users Group also now answers |
@koujan @mbronek7
2.Then Follow the answer to this question religiously (for OpenCV 3.3 at least but possibly for 3.2 as well): |
Managed to solve it. Added the OpenCV lib path to the LIBRARY_DIRS in my Makefile.config. |
How to do it: I tried sth like: INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial usr/include/opencv2 |
I did this LIBRARY_DIRS:= ~/opencv-3.3.0/build/lib Note: This is not the opencv which gets installed in /usr/include but the original opencv where I used make. |
run these commands
do
hope it helps. |
@Laowai01 Sorry, the method you mentioned did not work. |
I finally found it's because I uncomment this line in my Makefile.config file: |
Why you are using opencv2 not opencv3? |
comment opencv = 3 line, it works for me, but who knows what kind of consequences it will have in the future, maybe need to reinstall with cuda8...But, than everything need to reinstall...s..h...i...t.... |
My project needs to use opencv2. So I don't have the uncertain consequences as you. |
I think I finally figured out. For some versions of OpenCV3 (mine OpenCV 3.1.0), there's only a
and add another line below:
Everything works fine for me. |
The problem is still there, I am using OpenCV 3.4 |
find where you install opencv3.x, then excute: |
I followed the instruction but when I |
opencv-python 3.4.5.20 don't work on me |
It took me a week to solve this problem... I want to share my solution with you in detail so fewer people would get stuck with this situation. In my case, the problem lies in the conflict between opencv2 and opencv3. My ubuntu was installed with opencv 2.4.9 before by someone else, but I didn't manage to find the build file of it and uninstall it. I learned somewhere that 'imgcodecs' only exists in opencv 3+, so I realized that caffe must have used opencv2 and then run into this mistake. I used cmake-gui to install opencv 3.4.3 (without clicking BUILD_opencv_world), and CMAKE_INSTALL_PREFIX was set to usr/local/opencv343 (whatever u like, just set to be separated from opencv2, which was installed in the default path). Then add usr/local/opencv343/lib to 'sudo gedit /etc/ld.so.conf.d/opencv.conf', and add 'PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig Then put 'usr/local/opencv343/include' and 'usr/local/opencv343/lib' behind the '(PYTHON INCLUDE)' and '(PYTHON LIB)' in the makefile.config respectively (before other paths). This works for me, where my ubuntu has both opencv 2 and 3. Hope it would work for you guys too. |
I commented the following code in the file
|
If you follow Xilinx the tutorial (https://github.com/Xilinx/Edge-AI-Platform-Tutorials/tree/master/docs/Darknet-Caffe-Conversion), the solution from eezywu works perfectly! Thanks! |
Found the solution on Makefile
and if on the upper thereis |
Hi..
My machine spec..
Ubuntu 16.04 LTS
python 2.7, opencv 2.4.11
I tried to compile py-faster-rcnn -> make -j8 && make pycaffe
and..... build failed..
CXX examples/cpp_classification/classification.cpp
CXX .build_release/src/caffe/proto/caffe.pb.cc
AR -o .build_release/lib/libcaffe.a
LD -o .build_release/lib/libcaffe.so.1.0.0-rc3
/usr/bin/ld: cannot find -lopencv_imgcodecs
collect2: error: ld returned 1 exit status
Makefile:570: recipe for target '.build_release/lib/libcaffe.so.1.0.0-rc3' failed
make: *** [.build_release/lib/libcaffe.so.1.0.0-rc3] Error 1
I added to Makefile opencv_imgcodecs, but still problem..
help me.. thanks.
The text was updated successfully, but these errors were encountered: