Missing symbol required by MATLAB
이전 댓글 표시
I downloaded AFQ https://github.com/yeatmanlab/AFQ/wiki with vistasoft and spm8 on my macOS Sierra MATLAB R2017a. I have been trying to run the example code, but the following error is returned:
"
Missing symbol '_malloc' required by
'/System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio->/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesis->/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices->/System/Library/PrivateFrameworks/TCC.framework/Versions/A/TCC->/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata->/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices->/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation->/Applications/MATLAB_R2017a.app/bin/maci64/libmwnativestrings.dylib->/Applications/MATLAB_R2017a.app/bin/maci64/libmwsettingscore.dylib->/Applications/MATLAB_R2017a.app/bin/maci64/libmwservices.dylib->/Applications/MATLAB_R2017a.app/bin/maci64/libmex.dylib->/Users/christinejou/Documents/MathWorks/R2017a/archives/common/matlab/vistasoft/mrDiffusion/src/dtiSplitTensor.mexmaci64'
"
... (and many lines of missing symbol like the one above for '_memcpy', '_memmove', etc.)
"
Error in dtiEig (line 65)
[eigVec,eigVal] = dtiSplitTensor(Y);
Error in dtiComputeFA (line 44)
[eigVec, eigVal] = dtiEig(eigVal);
Error in AFQ_WholebrainTractography (line 84)
fa = dtiComputeFA(dt.dt6);
Error in AFQ_example (line 23)
wholebrainFG = AFQ_WholebrainTractography(dt,'test');
"
I've checked to make sure that I have added the paths to the AFQ/vistasoft/spm8 correctly and tried recompiling the MEX files, but I still get the same error. I have been trying to troubleshoot this for a while and think this may be a MATLAB version compatibility problem, but I'm unsure how to continue.
Does anyone have some pointers on how to fix this? Thanks again and any help would be much appreciated.
댓글 수: 9
dpb
2018년 8월 21일
That would look like an installation problem with the C/C++ compiler and the link library path not finding the RTL. Those are base compiler library routines, not the user code.
Can you compile any mex function?
Walter Roberson
2018년 8월 21일
That symbol would typically be in the C standard library, -lc
chriskjou
2018년 8월 21일
dpb
2018년 8월 21일
That's an error in the C source code for the default options of a C99 compiler; you didn't get far enough to find out if the standard libraries are going to be found.
I'm not a C programmer and don't know which compiler you're using to know what switch you can set to ignore warnings and whether it might possibly succeed if did or not or whether there's one for compiling pre-C99 C source that would accept the implicit declaration.
The surest route would be to look up and write the proper declaration for the function.
dpb
2018년 8월 26일
Can you successfully run mex setup and build/run one of the simple example files? That's the place to begin, until the "easy" works, there's no point in trying "hard". :)
There's quite a lot of detailed doc for mex, but it's not something that doesn't take quite a bit of study to learn how to write/debug code to use it successfully beyond the introductory level.
I'm not sure what the real Q? here is; the comment above says that the mex file compiled with an updated version so don't know what the limitation is on continuing. To use the result, you do have to have the .mex file located somewhere on the matlabpath, of course.
chriskjou
2018년 8월 30일
Walter Roberson
2018년 8월 30일
The message from mex -setup is informational, not an error. It tells you what has been configured, how to choose a configuration; and gives a message warning that if you were using code from about a decade ago that you could have problems.
dpb
2018년 8월 30일
I would think you would need to recompile everything that is part of the mex file(s) you're trying to use, yes, to have everything consistent. Otherwise, whatever references there are to the runtime is based on whatever compiler/release those modules were compiled with and that could be either somewhat different in internal naming conventions or interface.
I "know nuthink!" about either the example you're trying to compile nor C++ in general so I have no knowledge of the specific symbol as far as where it might be in the system; once past the most basic of C standard libraries, I'm totally at sea.
Again, I'd suggest going back to the basics first...can you get any C++ mex file to compile/link; then begin to add the complexities of whatever libraries are being used in the particular package.
답변 (0개)
카테고리
도움말 센터 및 File 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!