How to specify /MT in MATLAB coder?

HI there,
I am using MATLAB coder to generate C++ code. Where can I set /MT (multithread) or /MD (multithread DLL)? Many thanks.

1 Comment

Abhishek
Abhishek on 16 Jun 2025
Edited: Abhishek on 16 Jun 2025
Hi @Theron FARRELL, You can set '/MT' or '/MD' in MATLAB Coder under Code Generation Settings then go to Toolchain, then to Custom Compiler Flags.

Sign in to comment.

Answers (1)

Cheers.
Is it here? If I choose C++, will I also need to add /MD in the row for C Compiler as well?

1 Comment

Yes, you need to add '/MD' or '/MT' to both the C Compiler and C++. Did setting such flag work for you @Theron FARRELL ?

Sign in to comment.

Categories

Find more on MATLAB Coder in Help Center and File Exchange

Products

Release

R2024a

Asked:

on 10 Jun 2025

Edited:

on 16 Jun 2025

Community Treasure Hunt

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

Start Hunting!