MATLAB: Difficulties making wrapper mex file on linux

wrapper mex file

Hi,
First I complied the fcnsuit.c file as follows in a linux terminal:
gcc -c -fPIE fcnsuite.c ld -o fcnsuite.so -shared fcnsuite.o
Then I open matlab and try to make a mex file as follows:
mex mlbsuite.c
Then I get following error message:
mlbsuite.o:In function 'mexFunction':
mlbsuite.c:(.text+0xae): undefined reference to 'dlopen'
mlbsuite.c:(.text+0xd6): undefined reference to 'dlsym'
mlbsuite.c:(.text+0x217): undefined reference to 'dlclose'
mex: link of ' "mlbsuit.mex64"' failed
How can I fix this?

Best Answer

Looks like you might need to add a
#include <dlfcn.h>
to mlbsuite.c?