Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: daniloz on November 15, 2012, 09:41:27 am

Title: Keybinder not compiling after commir r8564
Post by: daniloz 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)
// ----------------------------------------------------------------------------
{ ...
...
Title: Re: Keybinder not compiling after commir r8564
Post by: Pecan on November 15, 2012, 02:13:57 pm
The change was made in 8563 (Killerbot).
It indeed will not compile.

What's up Killer?
Title: Re: Keybinder not compiling after commir r8564
Post by: Miguel Gimenez 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.
Title: Re: Keybinder not compiling after commir r8564
Post by: oBFusCATed on November 15, 2012, 05:42:18 pm
Great fun  ;D
Title: Re: Keybinder not compiling after commir r8564
Post by: killerbot 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
Title: Re: Keybinder not compiling after commir r8564
Post by: killerbot 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 ?)