SGL-UT / GPSTk

ATTENTION: This repository has been moved and is for archival purposes only. GPSTk toolkit has been renamed to GNSSTK and has been split into two new separate repositories. GNSSTK now only contains libraries while the other repository GNSSTK-APPS contains only applications. The rename and split into libraries and applications started with version v12.0.0 on September 2021. GPSTk --> GNSSTK at https://gitlab.com/sgl-ut/gnsstk --> GNSSTK-APPS at https://gitlab.com/sgl-ut/gnsstk-apps
Other
339 stars 182 forks source link

Wrong usage of mkdir in Mingw/Msys2 Build #33

Closed xaedes closed 3 years ago

xaedes commented 7 years ago

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.