Linux compilation error error:'fopen_s' was not declared in this scope

Different operating systems have different definitions, names, and parameters of functions. You need to add code before the file:

#ifdef __unix
#define fopen_s(pFile,filename,mode) ((*(pFile))=fopen((filename),  (mode)))==NULL
#endif

Guess you like

Origin blog.csdn.net/daijingxin/article/details/110777856