Fix wxMkDir call by adding missing mode_t argument (PR #26042)

28 views
Skip to first unread message

Proshanto-1234

unread,
Dec 20, 2025, 5:50:03 AM (3 days ago) Dec 20
to wx-...@googlegroups.com, Subscribed

Updated wxMkDir call to include mode_t parameter for directory creation, which fixes error:
src/common/filefn.cpp:663:17: error: too few arguments to function ‘int wxMkDir(const wxString&, mode_t)’


You can view, comment on, or merge this pull request online at:

  https://github.com/wxWidgets/wxWidgets/pull/26042

Commit Summary

  • ba7e302 Fix wxMkDir call by adding missing mode_t argument

File Changes

(1 file)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26042@github.com>

Scott Talbert

unread,
Dec 20, 2025, 9:46:34 AM (3 days ago) Dec 20
to wx-...@googlegroups.com, Subscribed
swt2c left a comment (wxWidgets/wxWidgets#26042)

On which platform and compiler are you seeing that compile error? wxMkDir() is declared in the header with a default argument for mode_t, so it shouldn't be needed:
https://github.com/wxWidgets/wxWidgets/blob/master/include/wx/filefn.h#L448


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26042/c3677872454@github.com>

VZ

unread,
Dec 20, 2025, 11:44:38 AM (3 days ago) Dec 20
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#26042)

This is a Cygwin-only issue, apparently: for some reason mode doesn't have a default value there. The right fix is almost certainly to add it to the declaration instead of this hack.

@Proshanto-1234 Can you check that this diff fixes the problem too?

diff --git a/include/wx/filefn.h b/include/wx/filefn.h
index 0abd2abe0c..e79c8f67c5 100644
--- a/include/wx/filefn.h
+++ b/include/wx/filefn.h
@@ -381,7 +381,7 @@ inline int wxRmDir(const wxString& path)
 inline int wxMkDir(const wxString& path, mode_t WXUNUSED(mode) = 0)
     { return wxCRT_MkDir(path.fn_str()); }
 #else
-inline int wxMkDir(const wxString& path, mode_t mode)
+inline int wxMkDir(const wxString& path, mode_t mode = 0777)
     { return wxCRT_MkDir(path.fn_str(), mode); }
 #endif
 


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26042/c3677948430@github.com>

Proshanto-1234

unread,
Dec 21, 2025, 12:09:51 AM (2 days ago) Dec 21
to wx-...@googlegroups.com, Subscribed
Proshanto-1234 left a comment (wxWidgets/wxWidgets#26042)

@swt2c the issue is in Cygwin on Windows. The generator is Unix Generator, and the build system is CMake, before running make -j$(nproc)


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26042/c3678463185@github.com>

Proshanto-1234

unread,
Dec 21, 2025, 12:35:31 AM (2 days ago) Dec 21
to wx-...@googlegroups.com, Subscribed
Proshanto-1234 left a comment (wxWidgets/wxWidgets#26042)

@vadz inline int wxMkDir(const wxString& path, mode_t mode = 0777) works! Here is it:
[ 36%] Building CXX object libs/base/CMakeFiles/wxbase.dir/////src/common/filefn.cpp.obj


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26042/c3678479587@github.com>

VZ

unread,
Dec 22, 2025, 8:51:32 PM (9 hours ago) Dec 22
to wx-...@googlegroups.com, Subscribed

Closed #26042 via cb03467.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26042/issue_event/21716147650@github.com>

Reply all
Reply to author
Forward
0 new messages