I have a C++ code that was written for linux originally, that uses mkstemp
. I'd like to be able to keep using mkstemp
regularly throughout the code as I port it to windows, compiling with MinGW32
. mkstemp
was added to MinGW
, but when I've looked at the MinGW
stdlib.h
, its version of mkstemp
is behind a few ifdefs
testing for a posix-compliant system.
I am receiving not declared in scope errors.
How are people using mkstemp
? What am I missing?
EDIT: No, this question is not a duplicate. I've read that other question, and my question is an extension of one of the comments/answers in there. Mainly "For the record, MinGW.org now provide mkstemp() and mkdtemp(), in releases of the MinGW runtime library, mingwrt-3.21 and later, (but not in the fatally flawed mingwrt-4.x variants, which have now been withdrawn from general release)."