C++ compiler produced errors.
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
how can i solve this problem?
i install__MATLAB Support for MinGW-w64 C/C++ Compiler
i use R2021a
3 commentaires
Prasanth Sunkara
le 16 Sep 2021
Can you please share the "deploy" command output generated in the MATLAB cmd window? It would have some hints on why that error happened.
Réponses (1)
Lokesh
le 19 Mar 2024
Modifié(e) : Lokesh
le 19 Mar 2024
Hi chan,
As per my understanding, you are encountering an error due to mismatch in the declaration of 'main' function between 'main.cpp' file and 'main.h' header file.
To resolve this issue, you need to ensure that the declaration of 'main' function in 'main.h' file matches its definition in 'main.cpp' file, particularly regarding the 'const' qualifier for 'argv' parameter.The original declaration in 'main.h' is 'extern int main(int argc, char **argv);' which conflicts with the definition in 'main.cpp' that uses 'const char * const argv[]'.
Please refer to the following steps to resolve the issue:
- Open the 'main.h' file and locate the declaration of 'main' function
- Modify the declaration to "extern int main(int argc, const char * const argv[]);" . Correcting the declaration in 'main.h' to 'extern int main(int argc, const char * const argv[]);' ensures that the the declaration matches its definition.
- Save the changes and recompile to check if the issue has been resolved.
I hope this helps you in resolving the issue.
0 commentaires
Voir également
Catégories
En savoir plus sur Raspberry Pi Hardware dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!