Can't compile multiple files with MEX
Show older comments
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
Find more on Write C Functions Callable from MATLAB (MEX Files) in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!