0

I am trying to install OpenCV on my Mac (OS X v10.6.3) with this guide : http://www.randomsequence.com/articles/opencv-snow-leopard/

The build failed. This'is the error:

ld: library not found for -lavcodec
collect2: ld returned 1 exit status
Command /Developer/usr/bin/g++-4.2 failed with exit code 1

Where can I found and install this library?

1
  • avcodec is part of ffmpeg library Aug 24, 2011 at 16:18

1 Answer 1

0

If you followed the article you have macports installed.

If so use it to install openCV e.g.

sudo port install opencv

the current macports installs openCV 2.2.0

If you have not used macports for some time you should update it first to get the latest versions see guide

sudo port selfupdate
sudo port upgrade outdated
3
  • If I try sudo port install opencv: Portfile changed since last build; discarding previous state. ---> Installing libiconv @1.14_0+universal Error: Target org.macports.install returned: /usr/bin/tar: +CONTENTS: Not found in archive /usr/bin/tar: Error exit delayed from previous errors Log for libiconv is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_textproc_libiconv/libiconv/main.log Error: Unable to upgrade port: 1 Error: Unable to execute port: upgrade cmake failed To report a bug, see <guide.macports.org/#project.tickets>
    – sarah
    Aug 24, 2011 at 16:23
  • try sudo port clean opencv then sudo port install opencv again
    – SSteve
    Aug 24, 2011 at 19:23
  • After updating I would also sudo port clean libiconv - as that is your current error - it has not got a complete tar file from somewhere,
    – mmmmmm
    Aug 24, 2011 at 23:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.