MATLAB Answers

0

Matlab Coder, Compiler can't find "tmwtypes.h"

Asked by Kai Hansmann on 1 Jun 2016
Latest activity Answered by cui
on 12 Oct 2019
Hello, I got Matlab Code from the Neural Net Pattern Recognition Toolbox and I tried to generate C++ Code with the Matlab Coder. But when I select Static Library or Source Code, Atmel AVR(8-bit) as Device (for Arduino) and the Arduino AVR toolchain the Arduino IDE always returns:
sketch\generated_code\interface\_coder_NeuralNetwork_api.c:12:22: fatal error: tmwtypes.h: No such file or directory
#include "tmwtypes.h"
Why didn't the Matlab Coder create that Library?

  0 Comments

Sign in to comment.

4 Answers

Answer by Kai Hansmann on 7 Jun 2016
 Accepted Answer

Problem solved.
Just use the Windows search, look for the filename on your HDD and copy it to your project folder!

  2 Comments

OMG ive been looking for a solution for ages and nothing worked but i did what you said and it worked! Thank you so much!
There might be a few files with the same name "tmwtypes.h". To be safe, you should always use the one in: matlabroot\extern\include.

Sign in to comment.



Answer by Kai Hansmann on 7 Jun 2016

Aren't I am doing exactly the same when I tick the lib option in the matlab coder? The help says:" lib for embeddable C/C++ static libraries " When I type " codegen NeuralNetwork -args {1} -config:lib " in the command window I always get a error:
??? Index expression out of bounds. Attempted to access element 5. The valid range is 1-1. More information Error in ==> NeuralNetwork Line: 12 Column: 22 Code generation failed: View Error Report Error using codegen
In Line 12 I am indexing the input value of the Function (which should be a inf x 5 Matrix) in the fifth column.
Am I using the codegen command wrong? How can I get the missing tmwtypes.h file?

  0 Comments

Sign in to comment.


Answer by cui
on 12 Oct 2019

https://ww2.mathworks.cn/help/coder/ug/use-a-c-dynamic-library-in-microsoft-visual-studio-project.html

  0 Comments

Sign in to comment.