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

2 Kommentare

Abhishek
Abhishek am 16 Jun. 2025
Bearbeitet: Abhishek am 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.
Theron FARRELL
Theron FARRELL vor etwa 3 Stunden
Sorry for a retarded reponse, but I fail to find Code Generation Settings. Instead, in Advanced->Additional Flags, I can add /MT, but it does not work. The generated .lib seems still to be /MD. I am using 2024a

Melden Sie sich an, um zu kommentieren.

Antworten (2)

Theron FARRELL
Theron FARRELL am 16 Jun. 2025

0 Stimmen

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

2 Kommentare

Abhishek
Abhishek am 16 Jun. 2025
Yes, you need to add '/MD' or '/MT' to both the C Compiler and C++. Did setting such flag work for you @Theron FARRELL ?
Theron FARRELL
Theron FARRELL vor etwa 3 Stunden
In 2024a, there is no C/C++ Compiler setting at all

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu MATLAB Coder finden Sie in Hilfe-Center und File Exchange

Produkte

Version

R2024a

Gefragt:

am 10 Jun. 2025

Beantwortet:

vor etwa 14 Stunden

Community Treasure Hunt

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

Start Hunting!

Translated by