MATLAB Answers

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

조회 수: 230(최근 30일)
Kai Hansmann
Kai Hansmann 2016년 6월 1일
댓글: A.H.T.Eranga De Silva 2021년 1월 14일
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?
  댓글 수: 1
A.H.T.Eranga De Silva
A.H.T.Eranga De Silva 2021년 1월 14일
Did you check the PacknGo feature in the Matlab coder?
Unless, do experience it please. I think that will solve your problem.
The PacknGo feature creates a folder containing all in one. Then try creating the project inside the PacknGo created folder.

댓글을 달려면 로그인하십시오.

채택된 답변

Kai Hansmann
Kai Hansmann 2016년 6월 7일
Problem solved.
Just use the Windows search, look for the filename on your HDD and copy it to your project folder!
  댓글 수: 2
Joaquin Ambia
Joaquin Ambia 2017년 9월 27일
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.

댓글을 달려면 로그인하십시오.

추가 답변(4개)

may miao
may miao 2020년 1월 9일
If anybody had problem in matlab:
c:\program files\matlab\r2019a\extern\include\matrix.h(683): fatal error C1083: Cannot open include file: “tmwtypes.h”: No such file or directory.
You can solve it in this way:
Find the matrix.h, row 683,change “ include<tmwtypes.h> into "include“tmwtypes.h”".
  댓글 수: 1
YiFan Huang
YiFan Huang 2020년 5월 2일
Thank you very much!

댓글을 달려면 로그인하십시오.



Kai Hansmann
Kai Hansmann 2016년 6월 7일
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?

cui
cui 2019년 10월 12일
https://ww2.mathworks.cn/help/coder/ug/use-a-c-dynamic-library-in-microsoft-visual-studio-project.html

Community Treasure Hunt

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

Start Hunting!

Translated by