Mex with MATLAB R2014A & Xcode6

2 vues (au cours des 30 derniers jours)
Vimal
Vimal le 22 Sep 2014
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 commentaires
Sergio
Sergio le 23 Sep 2014
Modifié(e) : Sergio le 23 Sep 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 le 23 Sep 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

Connectez-vous pour commenter.

Réponses (1)

Ken Atwell
Ken Atwell le 24 Sep 2014
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.

Catégories

En savoir plus sur Call C++ from MATLAB dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by