Question about building MEX file
显示 更早的评论
Hello,
I'm learning others' work on building MEX file and find a command like the following:
mex [certain source files] rfsub.o -o mexClassRF_train -lm -DMATLAB -O -v
I have several questions about this command and couldn't find answers from google...
1) rfsub.o is certain pre-compiled object file that has been provided, I can't figure out the usage of this 'rfsub.o' in the command line. (My guess is rfsub.o is actually the object file compiled from the source files, namely the output of this mex command, the author provided the pre-compiled file just for our convenience. If my guess is right then the 'rfsub.o' in the command line is to define the name of output?)
2) What is '-lm' for? I check the document, there's an option '-lname' which is for linking with object library, so I guess -lm means linking with a library named 'm'? However I couldn't find any file provided with name 'm', seems my guess is wrong...
3) What is -DMATLAB for? Again the document says '-D' is equivalent to '#define name directive' in C/C++, I still can't get it, in C/C++ when you define something you have #define name value, here you only have #define name, what's that mean then?
Thank you in advance!
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 MATLAB Compiler 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!