How can I create a mex file with cpp file + lib
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Captain Youss
am 16 Apr. 2020
Beantwortet: Aparna Singh
am 17 Apr. 2020
Hello,
With Matlab 2016b I've generate mex file like this (with vs2013 & vs2019 compilers ) :
mex ('-v','-I/../include', 'test.cpp', '-l../lib/test.lib' , '-l../lib/test2.lib')
It works fine, when i want to use the mex file with Simulink.
But, when i want to use it in the same way with Matlab R2019b, it doesn't work.
The link between Simulink and the mex file (only those which have been generated with cpp file) doesn't work.
How can i create a mex file with cpp file for Matlab R2019?
Best regards
0 Kommentare
Akzeptierte Antwort
Aparna Singh
am 17 Apr. 2020
Hey! so I would highly suggest this link: https://www.mathworks.com/matlabcentral/answers/377799-compiling-mex-files-without-the-mex-command
I just started using mex files myself and this file was super helpful. Also just to be on a safe side you may want to check compiler compatibility. But the first link should do it for you. You need the .def file for it to work. Hope this helps.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Simulink Coder finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!