Mex with MATLAB R2014A & Xcode6

Hi,
I'm currently working on developing algorithms in MATLAB and deploying them on iOS. My set-up includes the following: * MATLAB R2014a * Xcode 6 * Max OS X Mavericks 10.9.5
I have been happily using MATLAB's mex with Xcode 5.x and OS X 10.9.4 previously. I was forced to update to Xcode 6 as my app development work requires me to do that, so rolling back to Xcode 5 is not an option. After the update, I'm unable to use mex to build applications for my work. I'm getting linker errors that I haven't encountered previously. I made changes to mexopts.sh but this hasn't resolved my issue. Can you provide a solution to resolve my issue?
Thanks!

3 comentarios

Geoff Hayes
Geoff Hayes el 22 de Sept. de 2014
Vimal - you might want to post some of the linker errors that you are observing so that others (who have observed the same) can provide some guidance.
Sergio
Sergio el 23 de Sept. de 2014
Editada: Sergio el 23 de Sept. de 2014
I'll second that. I now get "stdlib.h" can't be found when trying to run a simulink model in rapid accelerator mode (that uses mex to compile).
I also modified my mexopts.sh and replaced 10.7 sdk with 10.9 to no avail.
Same setup as you Vimal, R2014A, Xcode 6.0.1, OSX 10.9.5
Vimal
Vimal el 23 de Sept. de 2014
Geoff,
Here is the log. Note that I verified using "lipo -info" that all of my opencv libs and the built archive binary ("static" lib) are for x86_64 arch
/Applications/MATLAB_R2014a.app/bin/mex -c -cxx -largeArrayDims -Iinclude -I/usr/local/Cellar/opencv/2.4.9/include/opencv -I/usr/local/Cellar/opencv/2.4.9/include src/MxArray.cpp -outdir lib Building with 'Xcode Clang++'. MEX completed successfully. ar -cq lib/libMxArray.a lib/*.o rm -f -f lib/*.o /Applications/MATLAB_R2014a.app/bin/mex -cxx -largeArrayDims -Iinclude -I/usr/local/Cellar/opencv/2.4.9/include/opencv -I/usr/local/Cellar/opencv/2.4.9/include src/+cv/CamShift.cpp -lMxArray -Llib /usr/local/Cellar/opencv/2.4.9/lib/libopencv_calib3d.dylib /usr/local/Cellar/opencv/2.4.9/lib/libopencv_contrib.dylib /usr/local/Cellar/opencv/2.4.9/lib/libopencv_core.dylib /usr/local/Cellar/opencv/2.4.9/lib/libopencv_features2d.dylib /usr/local/Cellar/opencv/2.4.9/lib/libopencv_flann.dylib /usr/local/Cellar/opencv/2.4.9/lib/libopencv_gpu.dylib /usr/local/Cellar/opencv/2.4.9/lib/libopencv_highgui.dylib /usr/local/Cellar/opencv/2.4.9/lib/libopencv_imgproc.dylib /usr/local/Cellar/opencv/2.4.9/lib/libopencv_legacy.dylib /usr/local/Cellar/opencv/2.4.9/lib/libopencv_ml.dylib /usr/local/Cellar/opencv/2.4.9/lib/libopencv_nonfree.dylib /usr/local/Cellar/opencv/2.4.9/lib/libopencv_objdetect.dylib /usr/local/Cellar/opencv/2.4.9/lib/libopencv_ocl.dylib /usr/local/Cellar/opencv/2.4.9/lib/libopencv_photo.dylib /usr/local/Cellar/opencv/2.4.9/lib/libopencv_stitching.dylib /usr/local/Cellar/opencv/2.4.9/lib/libopencv_superres.dylib /usr/local/Cellar/opencv/2.4.9/lib/libopencv_ts.a /usr/local/Cellar/opencv/2.4.9/lib/libopencv_video.dylib /usr/local/Cellar/opencv/2.4.9/lib/libopencv_videostab.dylib -output +cv/CamShift.mexmaci64 Building with 'Xcode Clang++'. Undefined symbols for architecture x86_64: "cv::merge(std::__1::vector<cv::Mat, std::__1::allocator<cv::Mat> > const&, cv::_OutputArray const&)", referenced from: MxArray::toMat(int, bool) const in libMxArray.a(MxArray.o) "cv::split(cv::Mat const&, std::__1::vector<cv::Mat, std::__1::allocator<cv::Mat> >&)", referenced from: MxArray::MxArray(cv::Mat const&, mxClassID, bool) in libMxArray.a(MxArray.o) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
if true
% code
end

Iniciar sesión para comentar.

Respuestas (1)

Ken Atwell
Ken Atwell el 24 de Sept. de 2014

1 voto

There is a similar problem (that is, problems with exactly the same OpenCV symbols) reported on Stack Overflow. The solution isn't pretty, but it might be helpful.

Categorías

Etiquetas

Preguntada:

el 22 de Sept. de 2014

Respondida:

el 24 de Sept. de 2014

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by