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

2 件のコメント

Abhishek
Abhishek 2025 年 6 月 16 日
編集済み: Abhishek 2025 年 6 月 16 日
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 2026 年 8 月 3 日
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

サインインしてコメントする。

回答 (2 件)

Theron FARRELL
Theron FARRELL 2025 年 6 月 16 日

0 投票

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

2 件のコメント

Abhishek
Abhishek 2025 年 6 月 16 日
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 2026 年 8 月 3 日
In 2024a, there is no C/C++ Compiler setting at all

サインインしてコメントする。

Test
Test 2026 年 8 月 3 日

0 投票

df

カテゴリ

ヘルプ センター および File ExchangeMATLAB Coder についてさらに検索

製品

リリース

R2024a

タグ

質問済み:

2025 年 6 月 10 日

回答済み:

2026 年 8 月 3 日

Community Treasure Hunt

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

Start Hunting!

Translated by