Ältere Kommentare anzeigen
Hello! Help me please.I want to use Ogre3D in mex (for s-function). http://www.ogre3d.org/ But my .cpp file contains OGRE's include files which Matlab doesn't see. In Visual Studio it can be adjusted in properties of solution. http://s001.radikal.ru/i196/1104/e6/e04d2a5746f8.jpg Is it possible to make so in Matlab? I will be grateful for any answer.Thank you.
Akzeptierte Antwort
Weitere Antworten (2)
Natalia
am 2 Apr. 2011
1 Kommentar
Jarrod Rivituso
am 2 Apr. 2011
Yes, you will need to add each include path and the library directories. Use the -l and -L flags to add library paths (-l) and actual library files (-L).
Again, the documentation has a table of all supported compiler switches:
http://www.mathworks.com/help/techdoc/ref/mex.html
Natalia
am 2 Apr. 2011
3 Kommentare
Kaustubha Govind
am 4 Apr. 2011
You don't have to specify names of header files - the -I option is added for the _directory_ containing the header files. You need something like:
mex -IC:\OgreSDK\samples\include -IC:\OgreSDK\include -I"..\include" -LC:\OgreSDK\lib mymexfile.c -l OgreMain_d.lib -l OIS_d.lib
Yes, simstruc.h is in a MATLAB directory that is automatically included by MEX
Natalia
am 5 Apr. 2011
Kaustubha Govind
am 5 Apr. 2011
Glad to be of help. :)
Kategorien
Mehr zu Adding custom doc finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!