Menu

#292 too many args to mkdir with MinGW

open
nobody
CMU-C LM TK (8)
5
2014-08-26
2012-06-13
No

I couldn't get CMUCLMTK to compile with Visual Studio, so I used the MinGW tools instead. However, building failed with this message:
rr_mkdtemp.c: In function 'rr_mkdtemp':
rr_mkdtemp.c:44:8: error: too many arguments to function 'mkdir'
c:\mingw\bin../lib/gcc/mingw32/4.6.2/../../../../include/io.h:302:37: note: declared here
make[3]: [rr_mkdtemp.lo] Error 1
make[2]:
[all-recursive] Error 1
make[1]: [all-recursive] Error 1
make:
[all] Error 2

The MinGW version of mkdir has only one argument, the file name. When I changed line 44 of rr_mkdtemp.c to the line below, it compiled without error:
if (!mktemp(template) || mkdir(template))

There's needs to be a #ifdef somewhere to keep this error from occurring.

Discussion


Log in to post a comment.