Mex: C2Matlab coding. Problems with libraries while linking (error LNK2019)
3 views (last 30 days)
Show older comments
Hi everybody!
This is my first question at MATLAB community. It's about mex. Here I go:
I'm integrating an external procedures for using a digital IO card using mex. The problem is that while I try to compile and link the code I get the error LNK2019.
I call the mex compiler/linker as:
if true
mex -win64 -v -g -lWDT_DIO64.lib pruebaargumentos.cpp % code
end
After that I get:
if true
pruebaargumentos.obj : error LNK2019: unresolved external symbol InitDIO referenced in function mexFunction
pruebaargumentos.mexw64 : fatal error LNK1120: 1 unresolved externals % code
end
The library is at the same path my cpp program is. I've included the header but anyway I get this error.
With the option -c I got the .obj file without a problem so the only thing that remain is linking it to the library (I hope).
4 Comments
Accepted Answer
Jan
on 31 Jul 2013
Try to use full paths for the file name of the library. If this works, there was a problem with finding the file in the LIBPATH. See -L argument for mex.
More Answers (0)
See Also
Categories
Find more on Introduction to Installation and Licensing in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!