Matlab Function Driver: Undefined reference to wrapper function

2 views (last 30 days)
hey guys, i am using the matlab function block approach to implement a driver for external hardware on the raspi. As written in matlab's driver guide, i use the matlab function block to call two functions, say init_func() and output_func(). The latter functions are wrapper functions that enclose the actual c code which should be compiled and downloaded to the raspi. The c-code (with the wrapper functions) lies in an external c-file. As said in the guide, I added this C-file as a custom source with the set_param command. I also wrote an extra h-file which declares my wrapper functions. I included this h-file in my c-file. I also added this h-file as a custom source with the set_param command. When I build the model, Matlab gets so far that it generates the c-File for the simulink block but it errors: MySimulinkBlock.c:(.text+0x1c): undefined reference to `init_func' MySimulinkBlock.c:(.text+0x2f8): undefined reference to `output_func'
This means that my wrapper functions are somehow not found. Any ideas? Thanks!

Answers (0)

Categories

Find more on MATLAB in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!