Author Topic: warning message about resource version number incorrect  (Read 4670 times)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5915
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
warning message about resource version number incorrect
« on: April 14, 2015, 05:03:50 am »
I got a message below when I update to the latest r10217, 32bit gcc/wx2.8.12.
See the image below:

Any ideas?
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 MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: warning message about resource version number incorrect
« Reply #1 on: April 14, 2015, 08:20:10 am »
This happens if a XRC files does have a wrong or no version number. I'm afraid you've to disable the plugins step by step to see what causes the issue. The manager and resource XRC files should be in line. An XRC file w/o version number is actually invalid, thats why I added the version number to all. We still have plenty of invalid XRC files, btw... so it could also be another issue.

However, you shouldn't see this in release builds. Its only visible in debug builds. Could you verify this, please?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5915
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: warning message about resource version number incorrect
« Reply #2 on: April 18, 2015, 12:08:16 am »
This happens if a XRC files does have a wrong or no version number. I'm afraid you've to disable the plugins step by step to see what causes the issue.
disable and enable it can't find the wrong xrc files. Instead, I set a breakpoint in bool Manager::LoadResource(const wxString& file), and check each zip file manually(the zip file name can be seen as the function argument) to see whether they have wrong xrc files.

Here are 5 wrong files I just caught:
Code
manager_resources.zip
    edit_keywords.xrc
    project_deps.xrc
    project_options.xrc
    virtualbuildtargetsdlg.xrc

codecompletion.zip
    goto_function_dlg.xrc



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 ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5915
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: warning message about resource version number incorrect
« Reply #3 on: October 04, 2015, 01:26:26 pm »
FYI: Just set a breakpoint in the file:
Code
"wxXmlResource::DoLoadFile (this=0x58b2b88, filename=...) at D:\wx3\src\xrc\xmlres.cpp:772" 
can catch all such warnings.

Code
    if (m_version != version)
    {
        wxLogWarning("Resource files must have same version number.");
    }
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 MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: warning message about resource version number incorrect
« Reply #4 on: October 04, 2015, 04:47:53 pm »
Code
    if (m_version != version)
    {
        wxLogWarning("Resource files must have same version number.");
    }
I should have fixed all those in SVN meanwhile. I also have a patch pending for wxSmith that it doesn't generate "wrong" XRC files. It happens as well with 3rd party plugins though where I cannot fix the code. For example: wxCrafter and cbInno.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ