Linux mex with gcc produces linker error with MATLAB map file

4 次查看(过去 30 天)
I'm trying to build a project from git that works fine for other users but I find I have a weird error that seems to indicate the mex/gcc build system isn’t configured properly. I'm getting this error from mex that doesn't really explain itself:
Building with 'gcc'.
/usr/local/MATLAB/R2018b/extern/lib/glnxa64/c_exportsmexfileversion.map: file not recognized: file format not recognized
collect2: error: ld returned 1 exit status
When I run again with mex -v I can see the following variables defined:
LDFLAGS : -pthread -Wl,--no-undefined -Wl,-rpath-link,/usr/local/MATLAB/R2018b/bin/glnxa64 -Wl,-rpath,'\$ORIGIN',-rpath,'\$ORIGIN/../../../matlab/lib',-rpath
LDTYPE : -shared
FUNCTIONMAP : "/usr/local/MATLAB/R2018b/extern/lib/glnxa64/mexFunction.map"
VERSIONMAP : "/usr/local/MATLAB/R2018b/extern/lib/glnxa64/c_exportsmexfileversion.map"
LINKEXPORT : -Wl,--version-script,"/usr/local/MATLAB/R2018b/extern/lib/glnxa64/mexFunction.map"
LINKEXPORTVER : -Wl,--version-script,"/usr/local/MATLAB/R2018b/extern/lib/glnxa64/c_exportsmexfileversion.map"
I've tried different MATLAB and gcc versions but got the same error every time. Any pointers on where to even look for the cause of this would be appreciated. The system is running CentOS7 with both default and SCL "devtoolset" versions of gcc tools installed from yum, i.e. no hand-built gcc.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Install Products 的更多信息

产品


版本

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by