My application is to convert an .m function into .c/.cpp files and read them again in Simulink using Matlab Function block.
I made a simple function stored in an .m file which inputs an RGB image and converts into Gray scale. -->Successful
I can call the .m function from workspace with an example video file and it works perfectly. (Actually uses only one matlab function internally "rgb2gray()")
Using MATLAB CODER, i convert this function into .cpp files --> Successful
(I have the generated .cpp and .h files in the folder)
I have a simple Simulink Model with Matlab Function block and video input/ viewer blocks. Now i would like to call .cpp files inside the matlab function to use it here in simulation.
crtl+D --> Fails. Error: undefined reference to `rgb2gray_tbb_uint8'
The Function is actually called inside the .cpp file which i am using in Matlab Function block. The .cpp file includes a header file "libmwrgb2gray_tbb.h" which should actually have the definition of 'rgb2gray_tbb_uint8()' function but the .h file is nowhere to be found in project folder.
I assume it should be a standard Library but its strange that Matlab Coder generated a function which is not known to it. I have included some source and header files in Simulation Target Pane of Model Explorer from the project but no help.
Any help from the experts here will be highly appreciated.
FYI: I am using MinGW compiler for C as well as C++, Matlab 2019b and have all the necessary Toolboxes.