필터 지우기
필터 지우기

Mex with MATLAB R2014A & Xcode6

조회 수: 1 (최근 30일)
Vimal
Vimal 2014년 9월 22일
답변: Ken Atwell 2014년 9월 24일
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
Sergio
Sergio 2014년 9월 23일
편집: Sergio 2014년 9월 23일
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 2014년 9월 23일
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

댓글을 달려면 로그인하십시오.

답변 (1개)

Ken Atwell
Ken Atwell 2014년 9월 24일
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.

카테고리

Help CenterFile Exchange에서 Write C Functions Callable from MATLAB (MEX Files)에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by