필터 지우기
필터 지우기

Trying to setup MinGW 4.9.2 for mex

조회 수: 3 (최근 30일)
Christopher  Davis
Christopher Davis 2016년 1월 22일
댓글: Walter Roberson 2016년 1월 29일
Ok, so I would like to incorporate some C code using mex, so I set about installing MinGW from TDM using the add-on provided by matlab. Every time I tried to install, I got an error saying I have the wrong version of mingw installed (which is ridiculous because I used the package downloaded from matlab, and yes, I unchecked the don't look for updates box). So I dug around in the script that checks the version I have installed. It's called mexSetupMinGW.m It runs fine up until line 136 when calling
[~, cmdout] = system([path_to_gcc , ' --version']);
cmdout is returned as an empty string, however when I type
C:\TDM-GCC-64\bin\gcc.exe --version
(the string sent to system() by [path_to_gcc , ' --version']) into command prompt I get this:
C:\>C:\TDM-GCC-64\bin\gcc.exe --version
gcc.exe (tdm64-1) 4.9.2
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
So the gcc.exe is there and it is the correct version, but something is going wrong on line 136 of mexSetupMinGW.m and I haven't the slightest idea of what to try next. Except maybe to manually set cmdout as the output I got from command prompt.
Anyone out there have any ideas?
edit:
Yep. I set cmdout = 'gcc.exe (tdm64-1) 4.9.2'; right under line 136 and the script executed properly. I then ran mex -setup and mingw64 popped up. That doesn't explain why system() was returning an empty string though...
  댓글 수: 3
Walter Roberson
Walter Roberson 2016년 1월 29일
Duplicated by http://uk.mathworks.com/matlabcentral/answers/264855-error-using-mex-no-description-of-error . Please do not have the same discussion in two different questions.
Walter Roberson
Walter Roberson 2016년 1월 29일
You appear to have a conflict of runtime libraries. This is the sort of thing you would use Dependency Walker to trace down.

댓글을 달려면 로그인하십시오.

답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by