error LNK2019, 3 unresolved external symbols
Mostrar comentarios más antiguos
Hi, I'm new to Matlab. I'm trying to build a C mex file. The C file and header files are all on the search path. I've been able to build C mex files, following the documents, but I'm not sure what's wrong here. Here's the error message I'm getting:
Error using mex Creating library DynamicProgrammingQ2.lib and object DynamicProgrammingQ2.exp DynamicProgrammingQ2.obj : error LNK2019: unresolved external symbol dp_costs referenced in function mexFunction DynamicProgrammingQ2.obj : error LNK2019: unresolved external symbol dp_build_gamma referenced in function mexFunction DynamicProgrammingQ2.obj : error LNK2019: unresolved external symbol dp_all_indexes referenced in function mexFunction DynamicProgrammingQ2.mexw64 : fatal error LNK1120: 3 unresolved externals
Please point me in the right direction.
2 comentarios
Geoff Hayes
el 14 de En. de 2015
Matthew - it sounds like your C code is referencing functions, for example dp_build_gamma (and a couple of others too), that you probably have defined in a header but you don't have the body for them. Could it be that there is a library that you should be linking into your build? Also, what is the mex command that you are using to build with?
Matthew
el 14 de En. de 2015
Respuesta aceptada
Más respuestas (2)
Md.Salman
el 25 de Ag. de 2016
0 votos
thanks
Md.Salman
el 25 de Ag. de 2016
Anyone who is trying to use the patchmatch algorithm and getting problems in building mex files using the .bat file, use the following commands from matlab command prompt.
>> mex knn.cpp mexutil.cpp nn.cpp nnmex.cpp patch.cpp vecnn.cpp simnn.cpp allegro_emu.cpp -output nnmex
>> mex knn.cpp mexutil.cpp nn.cpp votemex.cpp patch.cpp vecnn.cpp simnn.cpp allegro_emu.cpp -output votemex
It took me a long time trying to figure out. Posting so that can be helpful to others.
Categorías
Más información sobre Write C Functions Callable from MATLAB (MEX Files) en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!