I want to load static library into MATLAB. It is impossible to do with loadlibrary function, so I wrote mexfunction where I have placed entry point for the function from my static library. Then I want to create mex file with:
mex -v -Iinclude -Iusr/include mex_func.c libmy_lib.a
Header files are stored in include folder (inside current working directory) and header files from some standard libraries used by my libmy_lib.a (like FFTW) are stored in usr/include folder. As a result, I get error:
collect2: error: ld returned 1 exit status
where all erros are induced by undefined reference to FFTW functions. What is wrong here?