Author Topic: Keybinder not compiling after commir r8564  (Read 9080 times)

daniloz

  • Guest
Keybinder not compiling after commir r8564
« on: November 15, 2012, 09:41:27 am »
Hi All,

I've found that after updating past r8564, the keybinder plugin is not compiling anymore. The error is
Code
..\..\..\.objs\plugins\contrib\keybinder\cbkeybinder.o: In function `ZN11cbKeyBinder21MergeAcceleratorTableEb':
C:/Work/codeblocks_trunk/src/plugins/contrib/keybinder/cbkeybinder.cpp:856: undefined reference to `GetFullMenuPath(int)'
..\..\..\.objs\plugins\contrib\keybinder\keybinder.o: In function `ZNK5wxCmd4SaveEP12wxConfigBaseRK8wxStringb':
C:/Work/codeblocks_trunk/src/plugins/contrib/keybinder/keybinder.cpp:696: undefined reference to `GetFullMenuPath(int)'

I've track the problem to the anonymous namespace introduced in menuutils.cpp, line 137, which causes the function GetFullMenuPath() (and FindMenuIdUsingFullMenuPath()) to be "local" to menuutils.cpp
Code
namespace
{
// ----------------------------------------------------------------------------
wxString GetFullMenuPath(int id)
// ----------------------------------------------------------------------------
{ ...
...

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2873
Re: Keybinder not compiling after commir r8564
« Reply #1 on: November 15, 2012, 02:13:57 pm »
The change was made in 8563 (Killerbot).
It indeed will not compile.

What's up Killer?

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1727
Re: Keybinder not compiling after commir r8564
« Reply #2 on: November 15, 2012, 05:09:05 pm »
Also, in commit 8561 a bug slipped in projectconfigurationpanel.cpp:

for ( size_t i=0; i<Categories.Count(); i++ )

became

for ( size_t cat = 0; cat < Categories.Count(); cat )

The ++ operator was missed, so the loop never ends.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Keybinder not compiling after commir r8564
« Reply #3 on: November 15, 2012, 05:42:18 pm »
Great fun  ;D
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5529
Re: Keybinder not compiling after commir r8564
« Reply #4 on: November 15, 2012, 06:56:01 pm »
Also, in commit 8561 a bug slipped in projectconfigurationpanel.cpp:

for ( size_t i=0; i<Categories.Count(); i++ )

became

for ( size_t cat = 0; cat < Categories.Count(); cat )

The ++ operator was missed, so the loop never ends.

fixed

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5529
Re: Keybinder not compiling after commir r8564
« Reply #5 on: November 15, 2012, 07:03:14 pm »
Hi All,

I've found that after updating past r8564, the keybinder plugin is not compiling anymore. The error is
Code
..\..\..\.objs\plugins\contrib\keybinder\cbkeybinder.o: In function `ZN11cbKeyBinder21MergeAcceleratorTableEb':
C:/Work/codeblocks_trunk/src/plugins/contrib/keybinder/cbkeybinder.cpp:856: undefined reference to `GetFullMenuPath(int)'
..\..\..\.objs\plugins\contrib\keybinder\keybinder.o: In function `ZNK5wxCmd4SaveEP12wxConfigBaseRK8wxStringb':
C:/Work/codeblocks_trunk/src/plugins/contrib/keybinder/keybinder.cpp:696: undefined reference to `GetFullMenuPath(int)'

I've track the problem to the anonymous namespace introduced in menuutils.cpp, line 137, which causes the function GetFullMenuPath() (and FindMenuIdUsingFullMenuPath()) to be "local" to menuutils.cpp
Code
namespace
{
// ----------------------------------------------------------------------------
wxString GetFullMenuPath(int id)
// ----------------------------------------------------------------------------
{ ...
...

OK found the cause, man this was very hacky code, good it became apparent now, however for me everything builded fine (and it still does, even after make clean).
But indeed in :
cbKeybinder.cpp
keybinder.cpp
magically they are aware of some method living somewhere dirty dirty) :
Code
extern wxString GetFullMenuPath(int);

Now this is nicely exported in the header.

EDIT : now idea why it builds for me (CB build and makefiles, could it be those pch's again ?)
« Last Edit: November 15, 2012, 07:05:41 pm by killerbot »