Info

This question is closed. Reopen it to edit or answer.

error running mex on mac c-code

1 view (last 30 days)
Roy Goodman
Roy Goodman on 3 Oct 2013
Closed: MATLAB Answer Bot on 20 Aug 2021
I'm trying to use a little bit of c-code in matlab. I'm running Matlab 2013B on OS X 10.8 and have Xcode 5.0. To figure this out I'm following the example in the instructions here:
when run
mex -v timestwo.c, I at first got an error because the file mexopts.sh
has many references to macosx10.7 that needed to be changed to maxosx10.8. That was easy to fix.
The next time I run it, I get the following output. I don't know how to fix this. Anyone?
-> xcrun -sdk macosx10.8 clang -c -I/Applications/MATLAB_R2013b.app/extern/include -I/Applications/MATLAB_R2013b.app/simulink/include -DMATLAB_MEX_FILE -fno-common -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -mmacosx-version-min=10.8 -fexceptions -DMX_COMPAT_32 -O2 -DNDEBUG "timestwo.c"
-> xcrun -sdk macosx10.8 clang -O -arch x86_64 -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -mmacosx-version-min=10.8 -bundle -Wl,-exported_symbols_list,/Applications/MATLAB_R2013b.app/extern/lib/maci64/mexFunction.map -o "timestwo.mexmaci64" timestwo.o -L/Applications/MATLAB_R2013b.app/bin/maci64 -lmx -lmex -lmat -lstdc++
Undefined symbols for architecture x86_64: "_mexFunction", referenced from: -exported_symbol[s_list] command line option ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
mex: link of ' "timestwo.mexmaci64"' failed.

Answers (0)

Tags

Products

Community Treasure Hunt

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

Start Hunting!