Ask Your Question

Revision history [back]

Problem compiling OpenCV 3.1.0 on Mac OSX Yosemite 10.10.5 with Qt5, ffmpeg and cuda

Hello everyone, Thank you in advance for your time and your help.

I already have successfully installed cmake, OpenCV 2.4, Qt5 and cuda on my Mac Book Pro that i could use with no problems.

I'm starting a new internship and i need to update OpenCV because i have to read video stream in h264 format from a UDP live stream that i have to synchronize with a UDP data live stream (from Tobii glasses 2).

  1. I first installed any system updates: latest OSX Yesemite update and XCode SDK 10.11.

  2. After that CMake was giving me warning a message: "CMAKE_OS_SYSROOT" was ignored because the folder didn't exist anymore.

    I manage to fixe this by adding to my environment the 2 variables in "~/.bash_profile":

    export SDKROOT = "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk" export MACOSX_DEPLOYMENT_TARGET="10.11"

  3. I then updated my Cuda sdk to the 7.5 release, using the cuda_7.5.20_mac.dmg that match my system. I already had in my "~/.bash_profile"

    export PATH="/usr/local/cuda/bin:$PATH"

    No problem here.

  4. Then i downloaded ffmpeg from github:

    git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg"

    and build it:

    ./configure --with-darwinssl --enable-tls-srp --with-gssapi make make install

    I tried this configuration options in order to fix the later bug when compiling OpenCV.

    This works fine and the library are installed in my "/usr/local" folder.

  5. Then i atempted to build opencv 3.1.0. I used Cmake GUI to set the desired options:

    with Qt, and setting Qt path

    with ffmpeg

    with cuda

    I pressed configure, generete and started compiling:

    make

This fails, every time i try, with or without ffmpeg: The compilator fails to link OpenCV "videoio" module and i get the following error message:

[ 33%] Linking CXX shared library ../../lib/libopencv_videoio.dylib Undefined symbols for architecture x86_64: "_CMBlockBufferCreateWithMemoryBlock", referenced from: _videotoolbox_common_end_frame in libavcodec.a(videotoolbox.o) "_CMSampleBufferCreate", referenced from: _videotoolbox_common_end_frame in libavcodec.a(videotoolbox.o) "_CMVideoFormatDescriptionCreate", referenced from: _av_videotoolbox_default_init2 in libavcodec.a(videotoolbox.o) "_SSLClose", referenced from: _tls_open in libavformat.a(tls_securetransport.o) _tls_close in libavformat.a(tls_securetransport.o) "_SSLCopyPeerTrust", referenced from: _tls_open in libavformat.a(tls_securetransport.o) "_SSLCreateContext", referenced from: _tls_open in libavformat.a(tls_securetransport.o) "_SSLHandshake", referenced from: _tls_open in libavformat.a(tls_securetransport.o) "_SSLRead", referenced from: _tls_read in libavformat.a(tls_securetransport.o) "_SSLSetCertificate", referenced from: _tls_open in libavformat.a(tls_securetransport.o) "_SSLSetConnection", referenced from: _tls_open in libavformat.a(tls_securetransport.o) "_SSLSetIOFuncs", referenced from: _tls_open in libavformat.a(tls_securetransport.o) "_SSLSetPeerDomainName", referenced from: _tls_open in libavformat.a(tls_securetransport.o) "_SSLSetSessionOption", referenced from: _tls_open in libavformat.a(tls_securetransport.o) "_SSLWrite", referenced from: _tls_write in libavformat.a(tls_securetransport.o) "_SecIdentityCreate", referenced from: _tls_open in libavformat.a(tls_securetransport.o) "_SecItemImport", referenced from: _import_pem in libavformat.a(tls_securetransport.o) "_SecTrustEvaluate", referenced from: _tls_open in libavformat.a(tls_securetransport.o) "_SecTrustSetAnchorCertificates", referenced from: _tls_open in libavformat.a(tls_securetransport.o) "_VTDecompressionSessionCreate", referenced from: _av_videotoolbox_default_init2 in libavcodec.a(videotoolbox.o) "_VTDecompressionSessionDecodeFrame", referenced from: _videotoolbox_common_end_frame in libavcodec.a(videotoolbox.o) "_VTDecompressionSessionInvalidate", referenced from: _av_videotoolbox_default_free in libavcodec.a(videotoolbox.o) "_VTDecompressionSessionWaitForAsynchronousFrames", referenced from: _videotoolbox_common_end_frame in libavcodec.a(videotoolbox.o) "_kCMFormatDescriptionExtension_SampleDescriptionExtensionAtoms", referenced from: _av_videotoolbox_default_init2 in libavcodec.a(videotoolbox.o) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: * [lib/libopencv_videoio.3.1.0.dylib] Error 1 make[1]: [modules/videoio/CMakeFiles/opencv_videoio.dir/all] Error 2 make: ** [all] Error 2

I ran out of ideas to solve this, maybe this has already been solved but i didn't find any similar post.

Thank you in advance for your help.