C++ shared library compiling/packaging errors
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Didier
el 19 de En. de 2015
Comentada: Didier
el 20 de En. de 2015
I’m working on a MacBook Pro (OS X Yosemite Version 10.10.1) with Matlab R2014b and Xcode 6.1.1. I’m trying to build a C++ shared library using the Library Compiler App graphical tool. I’ve followed the recommandations of the documentation and was successful in building and using the shared library for the addmatrix.m example. When I go through the same steps for my project with multiple .m files organized around a main.m file, the process of creating the binary files and the different directories seems to be completing fine. Unfortunately, there are some issues reported in the PackagingLog.txt file that prevent me to later integrate correctly the shared library into a testing application. The compiling command seems to complain about the types of the created main.cpp file arguments and returning variable in relation to the main.h include file.
For instance: main.h:114:25: error: 'main' must return 'int' extern LIB_main_CPP_API void MW_CALL_CONV main(int nargout, mwArray& flagg, const mwArray& dum); ^~~~ int main.cpp:122:1: error: 'main' must return 'int' void MW_CALL_CONV main(int nargout, mwArray& flagg, const mwArray& dum) ^~~~ int
main.h:114:43: error: second parameter of 'main' (environment) must be of type 'char '
main.cpp:122:19: error: second parameter of 'main' (argument array) must be of type 'char ' void MW_CALL_CONV main(int nargout, mwArray& flagg, const mwArray& dum)
Any idea? I haven’t included all the files but I can do it if needs be. Thank you for your help.
0 comentarios
Respuesta aceptada
Titus Edelhofer
el 20 de En. de 2015
Hi,
I'm not sure, but I could imagine it's the name "main". In C/C++ the main function has a special meaning (and a special signature). Try to rename your main.m to mainfcn.m or what ever and let us know if the problem still exists.
Titus
Más respuestas (0)
Ver también
Categorías
Más información sobre Deploy to C++ Applications Using mwArray API (C++03) en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!