3

I am trying to install opencv on Mac OSX Lion.

brew install opencv

I get the following error (and a few other similar ones)

Error: The linking step did not complete successfully
The formula built, but is not symlinked into /usr/local
You can try again using `brew link jpeg'

When I do

brew link jpeg
Linking /usr/local/Cellar/jpeg/8d... ln: wrjpgcom: File exists

I do not understand what this means? What should I be doing? Thanks

y2p
  • 4,791
  • 10
  • 40
  • 56

2 Answers2

5

Check for the following files in the /usr/local folder:

bin/cjpeg
bin/djpeg
bin/jpegtran
bin/rdjpgcom
bin/wrjpgcom
include/jconfig.h
include/jerror.h
include/jmorecfg.h
include/jpeglib.h
lib/libjpeg.8.dylib
lib/libjpeg.a
share/man/man1/cjpeg.1
share/man/man1/djpeg.1
share/man/man1/jpegtran.1
share/man/man1/rdjpgcom.1
share/man/man1/wrjpgcom.1

For brew link jpegto succeed:

  1. Remove (and backup) any of the aforementioned files
  2. launch brew link jpeg again.
David Riccitelli
  • 7,491
  • 5
  • 42
  • 56
  • I individually deleted each file that `brew link jpeg` kept throwing back as an error. – rs77 Apr 02 '13 at 21:49
3

Find the file wrjpgcom outside the Cellar and delete it.

The problem is Homebrew is trying to symlink that file into /usr/local but the destination for the symlink already exists as another file.

mxcl
  • 26,392
  • 12
  • 99
  • 98
  • There are so many files that have to be deleted. And the deleted files keep coming back. Is there an easier way? – y2p Mar 19 '12 at 00:41
  • 2
    `brew ls --unbrewed` will list everything you installed and that Homebrew **did not** install. You can pass that to rm at your own risk. – mxcl Mar 19 '12 at 00:51