Mex, how to make visual studio support C11 standard?

7 visualizzazioni (ultimi 30 giorni)
I am building a mex function from c language, which uses a non-standard data type, i.e. double complex,
double complex *my_function ( int n, double complex a[] );
When I build on linux using gcc 7.2.0, there is no problem.
When I build on windows using MinGw, there is no problem.
When I build on windows using visual studio 2017, it throws syntax error, "error C2143: syntax error: missing '{' before '*'". I believe this error indicates visual studio does not support the data type double complex. I learned from here visual studio 2019 supports C11 and C17. Since C99 standard already support double complex, C11 and C17 will support, too. So I switched to visual studio 2019, and run the following command,
opts{1} = '-g'; % for debug
opts{2} = 'COMPFLAGS="$COMPFLAGS /std:c11"'; % add support for C11 standard
mex('-v',opts{:}, 'my_file.c');
However, the syntax error comes again.
So, how can I make visual studio support C11 standard?

Risposta accettata

Bruno Luong
Bruno Luong il 26 Dic 2020
"What’s not:
While there is currently no support for any C11 optional features, we are committed to providing the most impactful optional features in future releases. Atomic and threading support are on our roadmap. Support for Complex numbers is currently not planned and their absence is enforced with the proper feature test macros. Please go to Visual Studio Developer Community and voice your support for features you wish to be implemented. We are looking for your input that we are making the correct prioritizations."
  1 Commento
Xingwang Yong
Xingwang Yong il 26 Dic 2020
Sorry, I just qucikly looked through web page and did not realize C11 is not supported.

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su MATLAB Compiler in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by