What is tmwtypes.h and how do I fix an error of it not being seen? Also, general Coder questions.

315 vues (au cours des 30 derniers jours)
So, I've got a function that runs in MATLAB and I have used the MATLAB Coder to convert to C/C++ code. I am doing this to get the MATLAB code onto an existing Android App. I have followed the "MATLAB to iPhone and Android Made Easy" this far. The code compiles and I can move it into my cpp file. When I compile my app, I get an error that says my code can't find "tmwtypes.h." I'm curious first as to what it does/means and how I can fix the error? I am also worried that it might be my makefile that is giving the error.
As a sidenote, I also noticed that the Coder made some .dll files. From my understanding, these won't work on Android so I was curious if maybe that means I am doing something wrong? I have used the Coder to make source code so I think I'm in the right area but I wanted to make this post to be 100% sure.
My code was written in 2014b MATLAB but I am using R2018a for compiling and the Microsoft Windows SDK v7.1. My target device is Generic and Unspecified (assume 32-bit Generic).
Thanks,
Blaine Minden
  2 commentaires
Anakin Zheng
Anakin Zheng le 18 Déc 2018
Hi Blaine,
Can you share some details about how you compile the code? Since 18a does not support SDK 7.1, I assume you write your own Makefile. Can you share more details?
Thanks
Anakin
Blaine Minden
Blaine Minden le 18 Déc 2018
Hello,
I forgot to check compatibility when I moved to 18a. I am now compiling using Microsoft Visual C++ 2017 v15.0. I have packaged that code and then moved it into my app's cpp folder. What should my next step be? I saw in the "MATLAB to Android Made Easy" that you are supposed to use an Android.mk file but I'm not really sure how to do that. It seems like the video is kind of dated because most people have moved to Android Studio instead of using a plugin in Eclipse. I have a decent understanding of how this is supposed to work, but I'm not sure how to get there.
Thanks
Blaine Minden

Connectez-vous pour commenter.

Réponses (2)

cui,xingxing
cui,xingxing le 12 Oct 2019
it is here: C:\Program Files\MATLAB\R2019a\extern\include

Mordechai Rorvig
Mordechai Rorvig le 21 Jan 2019
Hi Blaine,
The file tmwtypes.h contains type definitions that are needed by the generated code. You can read more about it in the doc page Mapping MATLAB Types to Types in Generated Code. If you use the packNGo function, the tmwtypes.h file is zipped up with the rest of the generated code files (if it is needed). You can then use that zip file to transfer all the needed files for your generated code. If you use this method then the tmwtypes.h file stored with the rest of the source files should be discoverable by your compiler.
The presence of dll files does not indicate that anything is wrong about your generated C source files. MATLAB Coder generates dll files, for example, if you have chosen a dynamic library for your code generation configuration object:
cfg = coder.config('dll');
For your hardware settings, you will want to select your device on the Hardware pane of the configuration settings.
open cfg;
Choose 'None - Select device below' for Hardware Board and then set the Device vendor and Device type to match the specifications of your external device. These settings control the hardware implementation parameters and other assumptions which can be important for attaining the correct generated code behavior on the target device.
  3 commentaires
Patrick Haus
Patrick Haus le 10 Jan 2022
Ken, I am experiencing that exact error and was wondering if you know of a workaround?

Connectez-vous pour commenter.

Produits


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by