Behebung von C-Fehler 'mode_t undeclared'
English
Deutsch
Problem:
Du hast C-Code wie
mode_t_example.c
mode_t mode;aber wenn du versuchst, es zu kompilieren, siehst du eine Fehlermeldung wie
mode_t_undeclared_output.txt
main.c: In function ‘main’:
main.c:4:2: error: unknown type name ‘mode_t’
mode_t mode;
^~~~~~Lösung
Add
fix_mode_t_error.c
#include <sys/stat.h>at the top of the source file where the error occured. In case you want further information about what mode_t represents, I recommend reading this blogpost.
Check out similar posts by category:
C/C++, GCC Errors
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow