A solution to the failure of Matlab/Simulink to generate executable files under Viusal studio compilation

​Image source: Find elements

Hello everyone, I am Li Slowly.

It took a week to solve the problem that Simulink could not compile and generate executable files, so I must mark it.

(for reference only)

The SCANeR2021 version I use, according to the predecessors, SCANeR2021 and Matlab2019 are the most compatible, and the Simulink model of Matlab2019 must be compiled with Visual Studio2019. This installation sequence must first install VS and then Matlab, so that VS can successfully compile the Simlink model. I have installed it strictly according to my experience, but the following problems still exist:

fatal error U1052: The file "\rtw\c\tools\vctools.mak" cannot be found, and the error is reported as follows.

Let me state first that Simulink can successfully communicate with SCANeR for joint simulation at this time, that is, VS can already compile the Simulink model at this time, but it cannot generate an executable file (exe) . I found a lot of methods on the Internet, but they were useless. After uninstalling and reinstalling VS and Matlab many times, it still didn’t work. I always felt that there was a problem with some environment variable. Finally, I accidentally discovered a rule, that is, my successful colleagues installed Matlab to the C drive. Yes, and I am on the D drive, with the attitude of giving it a try, in the end, it succeeded, and the exe file can be generated, which is strange. . .

I still feel the problem of environment variables. Both VS and Matlab are huge software. The module calls between the two need to be controlled by environment variables. If the direction is wrong, it will not succeed. And installing both to the C drive may be a solution for a blind cat encountering a dead mouse . Good luck seeing you here too.

Official account - drive slowly

The road is slow, continuous and hard, and it takes a long time for success.

Guess you like

Origin blog.csdn.net/weixin_50262060/article/details/118279840