Code::Blocks Forums
User forums => Help => Topic started by: hibbity on May 26, 2011, 07:32:53 pm
-
Using Ubuntu 11.04, Codeblocks 10.05 installed from Ubuntu repositories (including sudo apt-get install codeblocks-contrib)
Following this tutorial:
http://wiki.codeblocks.org/index.php?title=Creating_a_simple_%22Hello_World%22_plugin (http://wiki.codeblocks.org/index.php?title=Creating_a_simple_%22Hello_World%22_plugin)
Compiled my test plugin with no problems.
Plugins-->Manage plugins...-->Install new
will add the plugin to the list of installed plugins, but it does not show on the Plugins drop-down menu.
Taking it a step further:
http://wiki.codeblocks.org/index.php?title=Creating_a_plugin_which_adds_new_item_into_wxSmith (http://wiki.codeblocks.org/index.php?title=Creating_a_plugin_which_adds_new_item_into_wxSmith)
I created a test class as per the tutorial, then added the namespace {...} block to the class implementation file,
then included the class header in the plugin implementation file, recompiled, (0 errors, 0 warnings) then re-installed the plugin.
Result was, as before, the plugin does not show up on the Plugins drop-down menu.
Neither does the plugin show up in the Contrib pallette.
Then I thought, oops, the namespace {...} block probably needs to be inserted into the class header file instead of the implementation file.
Then codeblocks would know the registration info from the header file included from the plugin.
Unfortunately, doing this creates 8 compiler errors, and 286 warnings.
The wiki tutorial glosses over this detail. Is there some way I can troubleshoot this?
The namespace {...} block in question:
namespace
{
// Loading images from xpm files
#include "wxtest16.xpm"
#include "wxtest32.xpm"
// This code provides basic info about item and registers
// it inside wxSmith
wxsRegisterItem<wxsTest> Reg(
_T("wxTest"), // Class name
wxsTWidget, // Item type
_T("wxWindows"), // License
_T("PT"), // Author
_T("pt@bigfoot.com"), // Author's email
_T("http://bigfoot.com/wx/"), // Item's homepage
_T("Contrib"), // Category in palette
80, // Priority in palette
_T("Test"), // Base part of names for new items
wxsCPP, // List of coding languages supported by this item
1, 0, // Version
wxBitmap(wxtest32_xpm), // 32x32 bitmap
wxBitmap(wxtest16_xpm), // 16x16 bitmap
false); // We do not allow this item inside XRC files
// Defining styles
WXS_ST_BEGIN(wxsTestStyles,_T("wxSIMPLE_BORDER"))
WXS_ST_DEFAULTS()
WXS_ST_END()
}
Compile errors attached in text file.
-
Looking at example plugins (wxChart, wxscustombutton), the namespace {...} blocks exists in the .cpp file.
What else can I check to ensure that the plugin shows up in the Plugins drop menu and in the Contrib pallette?
-
Ooops, moved issue to the Plugins development forum. :-|