Author Topic: r13615 fails to compile with wxWidgets-3.3.0.0  (Read 3742 times)

Offline everSome

  • Multiple posting newcomer
  • *
  • Posts: 52
r13615 fails to compile with wxWidgets-3.3.0.0
« 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.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6075
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: r13615 fails to compile with wxWidgets-3.3.0.0
« Reply #1 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?

If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline everSome

  • Multiple posting newcomer
  • *
  • Posts: 52
Re: r13615 fails to compile with wxWidgets-3.3.0.0
« Reply #2 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.

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1708
Re: r13615 fails to compile with wxWidgets-3.3.0.0
« Reply #3 on: February 18, 2025, 10:30:21 am »
Yes, wxGetTranslation() is the recommended method; see p.e this PR.

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1708
Re: r13615 fails to compile with wxWidgets-3.3.0.0
« Reply #4 on: February 18, 2025, 01:54:41 pm »
I am fixing those issues, will commit in a while...

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1708
Re: r13615 fails to compile with wxWidgets-3.3.0.0
« Reply #5 on: February 18, 2025, 04:44:58 pm »
Fixed in r13616.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7739
    • My Best Post
Re: r13615 fails to compile with wxWidgets-3.3.0.0
« Reply #6 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.
« Last Edit: February 26, 2025, 05:49:59 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1708
Re: r13615 fails to compile with wxWidgets-3.3.0.0
« Reply #7 on: February 26, 2025, 05:55:37 pm »
This was fixed six hours ago by r13622.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7739
    • My Best Post
Re: r13615 fails to compile with wxWidgets-3.3.0.0
« Reply #8 on: March 22, 2025, 12:12:34 am »
This was fixed six hours ago by r13622.

The fixed has gone missing, I think.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Wkerry

  • Multiple posting newcomer
  • *
  • Posts: 79
Re: r13615 fails to compile with wxWidgets-3.3.0.0
« Reply #9 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.

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1708
Re: r13615 fails to compile with wxWidgets-3.3.0.0
« Reply #10 on: March 22, 2025, 10:23:20 am »
Applied again in r13638.