1

I installed opencv(3.1.0) on Mac OS X(10.11), but it gives me this error:

dyld: Library not loaded: /usr/local/opt/libpng/lib/libpng16.16.dylib Referenced from: /usr/local/lib/libopencv_highgui.2.4.dylib Reason: Incompatible library version: libopencv_highgui.2.4.dylib requires version 37.0.0 or later, but libpng16.16.dylib provides version 36.0.0

Does anyone know how to fix this?

David Doria
  • 9,873
  • 17
  • 85
  • 147

1 Answers1

0

How did you install opencv 3.1?

One thing that seems strange is that your post title says opencv 3.1, but the libraries that throw the error seem to be from version 2.4. Perhaps you had opencv2.4 and installed opencv3.1 on top of it? If you do have opencv 3.1 then you should make sure that xcode is looking for the opencv libraries in the right place, as that could be throwing things off.

With that said it seems like opencv is expecting a newer version of libpng than the one you have installed. Is it possible to update that library? If so, then maybe updating followed by a reinstall of opencv could fix it.

I'm not sure what version of libpng opencv3.1 expects, so I would make sure you're linking against the opencv3.1 libraries first.

mynameisjohnj
  • 421
  • 4
  • 12
  • Thanks, I solve this problem, (1)update limping (2)remove all of opencv(2.4 & 3.1) and reinstall opencv 3.1.Then it works。 anyway,Thinks very much。(sorry ,My English is poor) – nefelibata00 Mar 26 '16 at 08:46