Why does MEX Compiler work in earlier versions of MATLAB but not in recent versions?
5 views (last 30 days)
Show older comments
MathWorks Support Team
on 1 Oct 2020
Answered: MathWorks Support Team
on 13 Dec 2020
I am trying to compile a 'C' mex function. This worked in earlier versions of matlab but with MATLAB R2020a, and the MinGW compiler, I am getting the following warnings and errors:
Error using mex
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
..\arObj\ar_open.obj:(.text[open_ar]+0xef): undefined reference to `__security_check_cookie'
..\arObj\ar_open.obj:(.xdata[$unwind$open_ar]+0x18): undefined reference to `__GSHandlerCheck'
..\arObj\flat_time.obj:(.text[ar_to_secs]+0xdc): undefined reference to
`__security_check_cookie'
..\arObj\flat_time.obj:(.xdata[$unwind$ar_to_secs]+0x8): undefined reference to
`__GSHandlerCheck'
collect2.exe: error: ld returned 1 exit status
Error in Make (line 36)
mex('-v', '-DWIN', ['-I' arSrcPath], 'asrch.c', …
How can I fix this?
Accepted Answer
MathWorks Support Team
on 1 Oct 2020
To resolve this issue, please ensure all dependencies are compiled with the same compiler and version of MATLAB. When all dependencies are recompiled with the currently used version of Matlab and compiler, the application will be able to compile and run successfully.
0 Comments
More Answers (0)
See Also
Categories
Find more on MATLAB Support for MinGW-w64 C/C++ Compiler in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!