Can't compile multiple files with MEX

I'm trying to compile the C++ code here: https://github.com/tum-vision/fastms using MEX. The repo already has a mex wrapper and a make file for mex compiling. The make file is only for unix based systems however and it is very necessary that I have this working for windows. I'm trying to compile this using inline Matlab 'mex' commands.
The directory structure is the following
/src
/libfastms
/solver
solver.h
...
/util
...
/mex
fastms_mex.cpp
...
Within the mex folder I am running
mex fastms_mex.cpp -I../libfastms -DDISABLE_CUDA -DDISABLE_OPENCV
and I run into the error
Error using mex
C:\Users\NAME~1\AppData\Local\Temp\mex_172671292282226_6476\fastms_mex.obj:fastms_mex.cpp:(.text+0x980): undefined reference to
`Solver::Solver()'
C:\Users\NAME~1\AppData\Local\Temp\mex_172671292282226_6476\fastms_mex.obj:fastms_mex.cpp:(.text+0xa7e): undefined reference to
`Solver::run(BaseImage const*, Par const&)'
C:\Users\NAME~1\AppData\Local\Temp\mex_172671292282226_6476\fastms_mex.obj:fastms_mex.cpp:(.text+0xaef): undefined reference to
`Solver::~Solver()'
C:\Users\NAME~1\AppData\Local\Temp\mex_172671292282226_6476\fastms_mex.obj:fastms_mex.cpp:(.text+0xb16): undefined reference to
`Solver::~Solver()'
collect2.exe: error: ld returned 1 exit status
I'm pretty confident that it should be sucessfully referencing solver.h, since it seems to be referencing other .h files in /util so I don't really know why this is. Is the makefile doing extra work with dependencies that is necessary?
Thanks in advance.

Answers (0)

Categories

Asked:

on 3 Jun 2017

Community Treasure Hunt

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

Start Hunting!