MATLAB Answers

MATLAB Coder global variable error

16 ビュー (過去 30 日間)
Florian Morsch
Florian Morsch 2018 年 6 月 29 日
コメント済み: Adam 2018 年 6 月 29 日
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="https://www.mathworks.com/help/vision/ug/portable-c-code-generation-for-functions-that-use-opencv-library.html">supported</a C++ compiler. **********************************************
Right now im using Visual Studio 2017, do i really have to use VS 2015?
  3 件のコメント
Adam
Adam 2018 年 6 月 29 日
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.

サインインしてコメントする。

回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by