Info

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

I get an error compiling c code using MEX

1 view (last 30 days)
Hugo Sanabria
Hugo Sanabria on 15 May 2014
Closed: MATLAB Answer Bot on 20 Aug 2021
I'm running Maverick (Mac OS 10.9.2, xcode 5.1.1) and Matlab R2013a. From the verbose printout you can see that I did everything as other blogs mentioned. Changing the mexopts.sh to SDK 10.8 and other changes (<http://stackoverflow.com/questions/19773916/compiling-mexopencv-in-os-x-10-9-with-xcode-5-and-matlab-r2013b)>. I can compile simple code but there is one in particular using external *.h libraries that is not compiling. Apparently there is a mistake on linking the libraries but I cannot find where is the problem. Any help will be much appreciated.
Thank you Hugo
************************************************************************ Warning: Neither -compatibleArrayDims nor -largeArrayDims is selected. Using -compatibleArrayDims. In the future, MATLAB will require the use of -largeArrayDims and remove the -compatibleArrayDims option. For more information, see: http://www.mathworks.com/help/matlab/matlab_external/upgrading-mex-files-to-use-64-bit-api.html ************************************************************************
-> mexopts.sh sourced from directory (DIR = $PREF_DIR) FILE = /Users/hsanabr/.matlab/R2013a/mexopts.sh ---------------------------------------------------------------- -> MATLAB = /Applications/MATLAB_R2013a.app -> CC = xcrun -sdk macosx10.8 clang -> CC flags: CFLAGS = -fno-common -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -mmacosx-version-min=10.8 -Dchar16_t=UINT16_T -fexceptions CDEBUGFLAGS = -g COPTIMFLAGS = -O2 -DNDEBUG CLIBS = /Applications/MATLAB_R2013a.app/bin/maci64/libmx.dylib /Applications/MATLAB_R2013a.app/bin/maci64/libmex.dylib /Applications/MATLAB_R2013a.app/bin/maci64/libmat.dylib -lc++ arguments = -DMX_COMPAT_32 -> CXX = xcrun -sdk macosx10.8 clang++ -> CXX flags: CXXFLAGS = -fno-common -fexceptions -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -mmacosx-version-min=10.8 -std=gnu++11 -stdlib=libc++ CXXDEBUGFLAGS = -g CXXOPTIMFLAGS = -O2 -DNDEBUG CXXLIBS = /Applications/MATLAB_R2013a.app/bin/maci64/libmx.dylib /Applications/MATLAB_R2013a.app/bin/maci64/libmex.dylib /Applications/MATLAB_R2013a.app/bin/maci64/libmat.dylib -lc++ arguments = -DMX_COMPAT_32 -> FC = gfortran -> FC flags: FFLAGS = -fexceptions -m64 -fbackslash FDEBUGFLAGS = -g FOPTIMFLAGS = -O FLIBS = /Applications/MATLAB_R2013a.app/bin/maci64/libmx.dylib /Applications/MATLAB_R2013a.app/bin/maci64/libmex.dylib /Applications/MATLAB_R2013a.app/bin/maci64/libmat.dylib -L -lgfortran -L -lgfortranbegin arguments = -DMX_COMPAT_32 -> LD = xcrun -sdk macosx10.8 clang -> Link flags: LDFLAGS = -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_R2013a.app/extern/lib/maci64/mexFunction.map LDDEBUGFLAGS = -g LDOPTIMFLAGS = -O LDEXTENSION = .mexmaci64 arguments = -> LDCXX = -> Link flags: LDCXXFLAGS = LDCXXDEBUGFLAGS = LDCXXOPTIMFLAGS = LDCXXEXTENSION = arguments = ----------------------------------------------------------------
-> xcrun -sdk macosx10.8 clang -c -I/Applications/MATLAB_R2013a.app/extern/include -I/Applications/MATLAB_R2013a.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 -Dchar16_t=UINT16_T -fexceptions -DMX_COMPAT_32 -O2 -DNDEBUG "wr_gfit.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_R2013a.app/extern/lib/maci64/mexFunction.map -o "wr_gfit.mexmaci64" wr_gfit.o /Applications/MATLAB_R2013a.app/bin/maci64/libmx.dylib /Applications/MATLAB_R2013a.app/bin/maci64/libmex.dylib /Applications/MATLAB_R2013a.app/bin/maci64/libmat.dylib -lc++
Undefined symbols for architecture x86_64: "_fconv_per", referenced from: _mexFunction in wr_gfit.o "_rescale_w_bg", referenced from: _mexFunction in wr_gfit.o "_shift_lamp", referenced from: _mexFunction in wr_gfit.o 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 ' "wr_gfit.mexmaci64"' failed.

Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!