User`s manual
1 Calling C and Fortran Programs from MATLAB
1-34
Figure 1-1: Troubleshooting MEX-File Creation Problems
Problems 1 through 5 refer to specific sections of the previous flowchart. For
additional suggestions on resolving MEX build problems, access the
Start
Acquire a supported compiler.
See “Supported Compilers”
Can you compile
and run timestwo.c
or timestwo.f?
no
Are you using a
supported compiler
?
no
Stop
yes
Double check your configuration.
See “
Testing Your Configuration
on UNIX (or Windows)
”
yes
Can you compile
your program
?
no
Check for:
ANSI C code
General C syntax errors
yes
Can MATLAB
load your MEX-file
?
no
Segmentation fault
or bus error
?
Use:
matlab -check_malloc
1
Link against all libraries
you intend to use.
Do you get
the right answer
?
no
Use:
yes
yes
matlab -check_malloc
1
Run in debugger.
Stop
Check:
Spelling of mexFunction
no
yes
1
UNIX only
mex -argcheck
2
mexPrintf
1
2
3
45
2
MEX-files only
for details.