Wrong usage of mkdir in Mingw/Msys2 Build
When building the extensions on Mingw/Msys2 platform I got following error:
In file included from H:/msys64/home/xaedes/GPSTk/core/lib/FileDirProc/FileFilte rFrame.hpp:48:0,
from H:/msys64/home/xaedes/GPSTk/ext/apps/checktools/CheckFrame .hpp:43,
from H:/msys64/home/xaedes/GPSTk/ext/apps/checktools/rnwcheck.c pp:37:
H:/msys64/home/xaedes/GPSTk/core/lib/FileDirProc/FileUtils.hpp: In function 'int gpstk::FileUtils::makeDir(const string&, unsigned int)':
H:/msys64/home/xaedes/GPSTk/core/lib/FileDirProc/FileUtils.hpp:113:41: error: to o many arguments to function 'int mkdir(const char*)'
mkdir(thispath.c_str(), mode);
^
In file included from H:/msys64/mingw64/x86_64-w64-mingw32/include/sys/stat.h:14 :0,
from H:/msys64/home/xaedes/GPSTk/core/lib/FileDirProc/FileUtils .hpp:48,
from H:/msys64/home/xaedes/GPSTk/core/lib/FileDirProc/FileFilte rFrame.hpp:48,
from H:/msys64/home/xaedes/GPSTk/ext/apps/checktools/CheckFrame .hpp:43,
from H:/msys64/home/xaedes/GPSTk/ext/apps/checktools/rnwcheck.c pp:37:
H:/msys64/mingw64/x86_64-w64-mingw32/include/io.h:280:15: note: declared here
int __cdecl mkdir (const char *) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
^~~~~
In file included from H:/msys64/home/xaedes/GPSTk/core/lib/FileDirProc/FileFilte rFrame.hpp:48:0,
from H:/msys64/home/xaedes/GPSTk/ext/apps/checktools/CheckFrame .hpp:43,
from H:/msys64/home/xaedes/GPSTk/ext/apps/checktools/rnwcheck.c pp:37:
H:/msys64/home/xaedes/GPSTk/core/lib/FileDirProc/FileUtils.hpp:116:34: error: to o many arguments to function 'int mkdir(const char*)'
mkdir(path.c_str(), mode);
^
In file included from H:/msys64/mingw64/x86_64-w64-mingw32/include/sys/stat.h:14 :0,
from H:/msys64/home/xaedes/GPSTk/core/lib/FileDirProc/FileUtils .hpp:48,
from H:/msys64/home/xaedes/GPSTk/core/lib/FileDirProc/FileFilte rFrame.hpp:48,
from H:/msys64/home/xaedes/GPSTk/ext/apps/checktools/CheckFrame .hpp:43,
from H:/msys64/home/xaedes/GPSTk/ext/apps/checktools/rnwcheck.c pp:37:
H:/msys64/mingw64/x86_64-w64-mingw32/include/io.h:280:15: note: declared here
int __cdecl mkdir (const char *) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
^~~~~
The mkdir
function provided by (admittedly my) mingw platform lacks the mode
parameter. This part in the FileUtils.hpp file is conditionally compiled. When compiling in Visual Studio (defined(_MSC_VER)==true
) another function_mkdir
without the mode
parameter is called. In Mingw the function is called mkdir
.