0

I'm using Matlab to generate some C code and MinGW is the compiler. This is how the toolchain is configured:

Toolchain

Once the build process is finished I get an executable file that I can run, and it works fine (it's just a simple Windows console program).

However, I can't find the options to run it automatically right after compilation. I've seen some code where they added ($PRODUCT) to the "Execute" option, but it didn't work for me. Any help is much appreciated!

Marcos
  • 107
  • 5
  • 1
    Where is this screenshot from? MATLAB? I see a line "Execute" in it. Put a path to the resulting executable in there. – Eugene Sh. Jul 19 '22 at 20:24
  • @Eugene Sh. I tried that too, but unfortunately it didn't work. However, I found a similar way: I've seen that someone suggested the command: make && start name.exe I can't explain why, but it worked for me. – Marcos Jul 19 '22 at 20:35

1 Answers1

0

Following the advice from here:

https://www.reddit.com/r/vim/comments/r6dthv/make_with_makefile_and_run_exe_from_same_command/

I added && start C:\...\test.exe (where ... is the full path) to the "Make Tool" option (bottom line) and it worked.

Marcos
  • 107
  • 5
  • 1
    Note this is the general solution to running two consecutive system commands, as in the top answer here: https://stackoverflow.com/q/8055371/3978545 – Wolfie Jul 21 '22 at 07:32