title: Compile OpenCV on Mac with FFMPEG instead of Quicktime
body: <p>I'm developing some code that will run on Linux with OpenCV and FFMPEG.  I would like to use my Mac to develop this code and I need the FFMPEG functionality on the Mac.  </p>
  
  <p>I've been able to run configure like this:</p>
  
  <pre><code>./configure --without-quicktime --with-ffmpeg --without-python --disable-apps CPPFLAGS=-I/opt/local/include LDFLAGS="-L/opt/local/lib -L/usr/local/share -L/usr/local/lib"
  </code></pre>
  
  <p>but when I run make I get this error:</p>
  
  <pre>
  Extracting /Users/adamb/opencv/trunk/opencv/src/./.libs/lib_cxcore.a
  (cd .libs/libcxcore.lax/lib_cxcore.a && ar x /Users/adamb/opencv/trunk/opencv/src/./.libs/lib_cxcore.a)
  g++ -dynamiclib -single_module  -o .libs/libcxcore.2.dylib  .libs/dummy.o  .libs/libcxcore.lax/lib_cxcore.a/cxalloc.o .libs/libcxcore.lax/lib_cxcore.a/cxarithm.o .libs/libcxcore.lax/lib_cxcore.a/cxarray.o .libs/libcxcore.lax/lib_cxcore.a/cxcmp.o .libs/libcxcore.lax/lib_cxcore.a/cxconvert.o .libs/libcxcore.lax/lib_cxcore.a/cxcopy.o .libs/libcxcore.lax/lib_cxcore.a/cxdatastructs.o .libs/libcxcore.lax/lib_cxcore.a/cxdrawing.o .libs/libcxcore.lax/lib_cxcore.a/cxdxt.o .libs/libcxcore.lax/lib_cxcore.a/cxerror.o .libs/libcxcore.lax/lib_cxcore.a/cximage.o .libs/libcxcore.lax/lib_cxcore.a/cxlapack.o .libs/libcxcore.lax/lib_cxcore.a/cxlogic.o .libs/libcxcore.lax/lib_cxcore.a/cxlut.o .libs/libcxcore.lax/lib_cxcore.a/cxmathfuncs.o .libs/libcxcore.lax/lib_cxcore.a/cxmatmul.o .libs/libcxcore.lax/lib_cxcore.a/cxmatrix.o .libs/libcxcore.lax/lib_cxcore.a/cxmean.o .libs/libcxcore.lax/lib_cxcore.a/cxmeansdv.o .libs/libcxcore.lax/lib_cxcore.a/cxminmaxloc.o .libs/libcxcore.lax/lib_cxcore.a/cxnorm.o .libs/libcxcore.lax/lib_cxcore.a/cxouttext.o .libs/libcxcore.lax/lib_cxcore.a/cxpersistence.o .libs/libcxcore.lax/lib_cxcore.a/cxrand.o .libs/libcxcore.lax/lib_cxcore.a/cxsumpixels.o .libs/libcxcore.lax/lib_cxcore.a/cxsvd.o .libs/libcxcore.lax/lib_cxcore.a/cxswitcher.o .libs/libcxcore.lax/lib_cxcore.a/cxtables.o .libs/libcxcore.lax/lib_cxcore.a/cxutils.o   -L/opt/local/lib -L/usr/local/share -L/usr/local/lib -lavformat -lavcodec -lpthread -ldl -lm  -march=prescott -msse -install_name  /usr/local/lib/libcxcore.2.dylib -Wl,-compatibility_version -Wl,3 -Wl,-current_version -Wl,3.0
      Undefined symbols:
        "_dgesdd_", referenced from:
        _cvSVD in cxsvd.o
        _cvSVD in cxsvd.o
    "_sgelsd_", referenced from:
        _cvSolve in cxlapack.o
        _cvSolve in cxlapack.o
    "_ssyevr_", referenced from:
        _cvEigenVV in cxlapack.o
        _cvEigenVV in cxlapack.o
    "_dgetrf_", referenced from:
        _cvDet in cxlapack.o
        _cvInvert in cxlapack.o
    "_dgetri_", referenced from:
        _cvInvert in cxlapack.o
        _cvInvert in cxlapack.o
    "_sgesdd_", referenced from:
        _cvSVD in cxsvd.o
        _cvSVD in cxsvd.o
    "_dgels_", referenced from:
        _cvSolve in cxlapack.o
        _cvSolve in cxlapack.o
    "_dgesv_", referenced from:
        _cvSolve in cxlapack.o
    "_sgetrf_", referenced from:
        _cvDet in cxlapack.o
        _cvInvert in cxlapack.o
    "_sgetri_", referenced from:
        _cvInvert in cxlapack.o
        _cvInvert in cxlapack.o
    "_dpotrf_", referenced from:
        _cvInvert in cxlapack.o
        _cvSolve in cxlapack.o
    "_dpotri_", referenced from:
        _cvInvert in cxlapack.o
    "_dpotrs_", referenced from:
        _cvSolve in cxlapack.o
    "_sgels_", referenced from:
        _cvSolve in cxlapack.o
        _cvSolve in cxlapack.o
    "_spotrf_", referenced from:
        _cvInvert in cxlapack.o
        _cvSolve in cxlapack.o
    "_spotri_", referenced from:
        _cvInvert in cxlapack.o
    "_sgesv_", referenced from:
        _cvSolve in cxlapack.o
    "_spotrs_", referenced from:
        _cvSolve in cxlapack.o
    "_dgelsd_", referenced from:
        _cvSolve in cxlapack.o
        _cvSolve in cxlapack.o
    "_dsyevr_", referenced from:
        _cvEigenVV in cxlapack.o
        _cvEigenVV in cxlapack.o
  ld: symbol(s) not found
  collect2: ld returned 1 exit status
  make[2]: *** [libcxcore.la] Error 1
  make[1]: *** [all-recursive] Error 1
  make: *** [all] Error 2
  </pre>
  
  <p>I tried using a newer version of OpenCV, 1.1pre1 and I get a similar error but with different symbols.  I'm using the same ./configure as above.</p>
  
  <pre>
  Extracting /Users/adamb/Downloads/opencv-1.1.0/otherlibs/highgui/./.libs/lib_highgui.a
  (cd .libs/libhighgui.lax/lib_highgui.a && ar x /Users/adamb/Downloads/opencv-1.1.0/otherlibs/highgui/./.libs/lib_highgui.a)
  g++ -dynamiclib  -o .libs/libhighgui.2.0.0.dylib  .libs/dummy.o  .libs/libhighgui.lax/lib_highgui.a/bitstrm.o .libs/libhighgui.lax/lib_highgui.a/cvcap.o .libs/libhighgui.lax/lib_highgui.a/cvcap_ffmpeg.o .libs/libhighgui.lax/lib_highgui.a/cvcap_images.o .libs/libhighgui.lax/lib_highgui.a/grfmt_base.o .libs/libhighgui.lax/lib_highgui.a/grfmt_bmp.o .libs/libhighgui.lax/lib_highgui.a/grfmt_exr.o .libs/libhighgui.lax/lib_highgui.a/grfmt_imageio.o .libs/libhighgui.lax/lib_highgui.a/grfmt_jpeg.o .libs/libhighgui.lax/lib_highgui.a/grfmt_jpeg2000.o .libs/libhighgui.lax/lib_highgui.a/grfmt_png.o .libs/libhighgui.lax/lib_highgui.a/grfmt_pxm.o .libs/libhighgui.lax/lib_highgui.a/grfmt_sunras.o .libs/libhighgui.lax/lib_highgui.a/grfmt_tiff.o .libs/libhighgui.lax/lib_highgui.a/image.o .libs/libhighgui.lax/lib_highgui.a/loadsave.o .libs/libhighgui.lax/lib_highgui.a/precomp.o .libs/libhighgui.lax/lib_highgui.a/utils.o .libs/libhighgui.lax/lib_highgui.a/window.o .libs/libhighgui.lax/lib_highgui.a/window_carbon.o   -L/opt/local/lib -L/usr/local/share -L/usr/local/lib ../../cxcore/src/.libs/libcxcore.dylib /opt/local/lib/libavformat.dylib /opt/local/lib/libavcodec.dylib ../../cv/src/.libs/libcv.dylib /Users/adamb/Downloads/opencv-1.1.0/cxcore/src/.libs/libcxcore.dylib /opt/local/lib/libjasper.dylib /opt/local/lib/libjpeg.dylib -lavformat -lavcodec -lpthread -ldl -lm  -march=prescott -msse2 -framework ApplicationServices -Wl,-framework -Wl,Carbon -install_name  /usr/local/lib/libhighgui.2.dylib -compatibility_version 3 -current_version 3.0 -Wl,-single_module
  Undefined symbols:
    "_av_rescale_q", referenced from:
        icv_av_write_frame_FFMPEG(AVFormatContext*, AVStream*, unsigned char*, unsigned int, AVFrame*)in cvcap_ffmpeg.o
    "_img_convert", referenced from:
        CvCapture_FFMPEG::retrieveFrame()       in cvcap_ffmpeg.o
        CvVideoWriter_FFMPEG::writeFrame(_IplImage const*)  in cvcap_ffmpeg.o
    "_av_free", referenced from:
        icv_alloc_picture_FFMPEG(int, int, int, bool)in cvcap_ffmpeg.o
        CvVideoWriter_FFMPEG::close()      in cvcap_ffmpeg.o
        CvVideoWriter_FFMPEG::close()      in cvcap_ffmpeg.o
        CvVideoWriter_FFMPEG::close()      in cvcap_ffmpeg.o
        CvVideoWriter_FFMPEG::close()      in cvcap_ffmpeg.o
        CvCapture_FFMPEG::close()      in cvcap_ffmpeg.o
    "_av_freep", referenced from:
        CvVideoWriter_FFMPEG::close()      in cvcap_ffmpeg.o
        CvVideoWriter_FFMPEG::close()      in cvcap_ffmpeg.o
    "_av_malloc", referenced from:
        CvVideoWriter_FFMPEG::open(char const*, int, double, CvSize, bool)in cvcap_ffmpeg.o
    "_av_sub_q", referenced from:
        CvVideoWriter_FFMPEG::open(char const*, int, double, CvSize, bool)in cvcap_ffmpeg.o
  ld: symbol(s) not found
  
  </pre>
  
  <p>If I add --enable-shared=no and OpenCV will compile, but then my programs won't run...</p>
  
  <p>Any suggestions as to how to get either of these to compile with the default --enable-shared?</p>