Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: everSome on February 18, 2025, 05:42:12 am

Title: r13615 fails to compile with wxWidgets-3.3.0.0
Post by: everSome on February 18, 2025, 05:42:12 am
Seems wxWidgets-3.3.0.0 has gotten stricter in checking usage of macros such as _() and friends. In particular, sdk/pluginmanager.cpp line 764 doesn't work.:
static wxString RemoveCRAndTranslate(const wxString& value)
{
    wxString Result(value);
    Result.Replace("\r\n", "\n");
    return _(Result);
}


See
https://wxwidgets.org/help/msgid-literals/
for details.
Title: Re: r13615 fails to compile with wxWidgets-3.3.0.0
Post by: ollydbg on February 18, 2025, 06:13:37 am
Thanks, so it looks like _() is not allowed by passing a wxString as argument.

How do we fix that issue in the function: RemoveCRAndTranslate()? Just remove the _() macro?

Title: Re: r13615 fails to compile with wxWidgets-3.3.0.0
Post by: everSome on February 18, 2025, 07:29:07 am
Maybe use something like:
const wxString& wxGetTranslation    (    const wxString &     string,
      const wxString &     domain = wxEmptyString,
      const wxString &     context = wxEmptyString
   )    

as it takes a wxString as input.
Title: Re: r13615 fails to compile with wxWidgets-3.3.0.0
Post by: Miguel Gimenez on February 18, 2025, 10:30:21 am
Yes, wxGetTranslation() is the recommended method; see p.e this PR (https://github.com/wxWidgets/wxWidgets/commit/cfe292a04ec550148f207d037a36a9b161c8313b).
Title: Re: r13615 fails to compile with wxWidgets-3.3.0.0
Post by: Miguel Gimenez on February 18, 2025, 01:54:41 pm
I am fixing those issues, will commit in a while...
Title: Re: r13615 fails to compile with wxWidgets-3.3.0.0
Post by: Miguel Gimenez on February 18, 2025, 04:44:58 pm
Fixed in r13616 (https://sourceforge.net/p/codeblocks/code/13616/).
Title: Re: r13615 fails to compile with wxWidgets-3.3.0.0
Post by: stahta01 on February 26, 2025, 05:43:15 pm
Code
--- a/src/plugins/contrib/clangd_client/src/codecompletion/parser/parser.cpp
+++ b/src/plugins/contrib/clangd_client/src/codecompletion/parser/parser.cpp
@@ -1567,7 +1567,7 @@ void Parser::ShowGlobalChangeAnnoyingMsg()
                        "on the project title in the Workspace tree and selecting\n"
                        "'Reparse current project'.");
 
-        AnnoyingDialog dlg(_("Global settings warning"), _(warningMsg), wxART_WARNING,
+        AnnoyingDialog dlg(_("Global settings warning"), warningMsg, wxART_WARNING,
                            AnnoyingDialog::OK);
         dlg.ShowModal();
     }//endif size

I had to apply this patch to build master from https://github.com/arnholm/codeblocks_sfmirror.git   13621

Tim S.
Title: Re: r13615 fails to compile with wxWidgets-3.3.0.0
Post by: Miguel Gimenez on February 26, 2025, 05:55:37 pm
This was fixed six hours ago by r13622 (https://sourceforge.net/p/codeblocks/code/13622/).
Title: Re: r13615 fails to compile with wxWidgets-3.3.0.0
Post by: stahta01 on March 22, 2025, 12:12:34 am
This was fixed six hours ago by r13622 (https://sourceforge.net/p/codeblocks/code/13622/).

The fixed has gone missing, I think.

Tim S.
Title: Re: r13615 fails to compile with wxWidgets-3.3.0.0
Post by: Wkerry on March 22, 2025, 03:30:24 am
Via github it was relatively easy to find that the following commit reverted it:
https://github.com/arnholm/codeblocks_sfmirror/commit/2cc176ba23528185ca18d5377510b64e7a81b38f#diff-4007afe15336751ba46fee72ba5ed7002efc465819b8384b5b0fb76edfd41741R394-R1570

The comment/svn reference is:
- Clangd_client Remove dead/unused code, no additions or code changes
git-svn-id: https://svn.code.sf.net/p/codeblocks/code/trunk@13636 2a5c6006-c6dd-42ca-98ab-0921f2732cef

I do not use SVN and find the github repo allot easier to use to find things.
Title: Re: r13615 fails to compile with wxWidgets-3.3.0.0
Post by: Miguel Gimenez on March 22, 2025, 10:23:20 am
Applied again in r13638 (https://sourceforge.net/p/codeblocks/code/13638/).