Using simulink to call c++ code via an s-function

1 visualización (últimos 30 días)
Adrian Bedford
Adrian Bedford el 13 de En. de 2016
Respondida: Pavithra Ashok Kumar el 19 de En. de 2016
I am trying to duplicate this example: http://uk.mathworks.com/matlabcentral/answers/102682-how-can-i-generate-an-s-function-that-calls-a-c-static-library-with-other-library-dependencies I get the following error: Mult_lib.lib(mult_cpp.obj) : error LNK2019: unresolved external symbol "void __cdecl operator delete(void *,unsigned int)" (??3@YAXPAXI@Z) referenced in function "void __cdecl deleteMult(void)" (?deleteMult@@YAXXZ) my_lib_adder_cpp.mexw32 : fatal error LNK1120: 1 unresolved externals Can you help please?

Respuestas (1)

Pavithra Ashok Kumar
Pavithra Ashok Kumar el 19 de En. de 2016
The issue may occur because of a mismatch in code settings. The library and associated header file should be included in both the Custom Code section for Simulation Target and under Code Generation. Simulation modes that use code generation (such as Accelerator mode) will still work as the Simulation Target includes are set up correctly.
Under the Code Generation -> Custom Code section, the option for "Use the same custom code settings as Simulation Target" can be selected. Hope this resolves your issue.

Categorías

Más información sobre Block and Blockset Authoring 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!

Translated by