Problem with mex files on Mountain Lion: explicit instantiation error
Show older comments
Hi, I'm working with MATLAB r2012b on Mountain Lion, and XCode version installed is 4.6.1. I've also used the patch at http://www.mathworks.it/support/solutions/en/data/1-IXBVKD/ and then I have typed "mex - setup" and selected the only option available
1: /Applications/MATLAB_R2012b.app/bin/mexopts.sh : Template Options file for building gcc MEX-files
I'm trying to use a framework for sparse modeling (written in C++) which uses mex files. In order to install the previous framework I have to call a matlab file inside the framework which calls mex function: however when I call this function I get the following message...
./linalg/linalg.h: At global scope:
./linalg/linalg.h: In instantiation of 'std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]':
./linalg/linalg.h:1083: instantiated from 'void Matrix<T>::print(const std::string&) const [with T = float]'
dictLearn/mex/mexTrainDL.cpp:197: instantiated from here
./linalg/linalg.h:1083: error: explicit instantiation of 'std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]' but no definition available
mex: compile of ' "dictLearn/mex/mexTrainDL.cpp"' failed.
The problem is the part with "error: explicit instantiation ... " Googling I have seen that I'm not the only one with this problem, but I don't know how to fix it. Thank you in advance for any help.
Mattia
Answers (1)
Di Yang
on 29 May 2013
0 votes
I solved a similar problem by changing the "MACOSX_DEVELOPMENT_TARGET = 10.5" to "10.6" in mexopts.sh
Categories
Find more on MATLAB Compiler in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!