MATLAB Answers

Mex unable to find rgb2gray_tbb_uint8 function

1 view (last 30 days)
Adil Murtaza Zuberi
Adil Murtaza Zuberi on 13 Feb 2020
Edited: Adil Murtaza Zuberi on 13 Feb 2020
Hello all,
My application is to convert an .m function into .c/.cpp files and read them again in Simulink using Matlab Function block.
Step1:
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()")
Step 2:
Using MATLAB CODER, i convert this function into .cpp files --> Successful
(I have the generated .cpp and .h files in the folder)
Step 3:
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.
Thanks,
Adil

  0 Comments

Sign in to comment.

Answers (0)

Sign in to answer this question.


Translated by