MATLAB Coder global variable error

5 views (last 30 days)
Florian Morsch
Florian Morsch on 29 Jun 2018
Commented: Adam on 29 Jun 2018
Im trying to use the MATLAB coder to generate code from my function.
When i check for errors, i get a "Could not find initial value for global variable 'AllMyDifferentVariables' " on every global variable i assigned.
But as you can see, i set the global variable and assign a value (empty) to each.
Could someone help me to figure out why it says they have no value even if they have?
Even if there is a nonempty variable it gives the error (see IsFound = false; , but still no initial value??? )
EDIT: After i changed the variables again ( not global anymore, strangely the other error i had before without global variables is gone now...) i have a new error:
The library method 'vision.internal.buildable.cascadeClassifierBuildable.updateBuildInfo' failed.
Caused by: ********************************************** Generated code from your project uses OpenCV and requires that you use a supported C++ compiler. Use 'mex -setup' to select a href="">supported</a C++ compiler. **********************************************
Right now im using Visual Studio 2017, do i really have to use VS 2015?
Adam on 29 Jun 2018
I would suggest that whatever the original problem was could be far better solved in other ways than using global variables which introduce myriad problems of their own (e.g. like this) which makes them not a good solution for any problem.

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!