To create my first plugin I followed the hints in 'Creating a simple "Hello World" plugin' (http://wiki.codeblocks.org/index.php?title=Creating_a_simple_%22Hello_World%22_plugin).
The tutorial is outdated, so I added the following paths
Build options -> Search directories -> Compiler
<SOURCE>/src/sdk/propgrid/include
<SOURCE>/src/sdk/scripting/include
<SOURCE>/src/sdk/wxFlatNotebook/include
<SOURCE>/src/sdk/wxscintilla/include
Build options -> Search directories -> Linker
<SOURCE>/src/sdk/wxscintilla/include
<INSTALL>/codeblocks/lib
and built the project.
When I try to install the *.cbplugin in the "Plugins->Manage plugins -> Install new" I get a
"One or more plugins were not installed succesfully".
So what did I do wrong...?
I created the plugin with C::B's plugin wizard as Tool plugin under Linux 2.6.13, gcc 4.0.2, binutils 2.16.91.0.2, wx 2.6.1, C::B svn 3593
Check C::B's debug log for more information. Did you create a resource .zip with a manifest for the plugin?
http://forums.next.codeblocks.org/index.php?topic=4290.msg33916#msg33916
Plug-Ins : some suggested "case" conventions
Quote from: TDragon on February 12, 2007, 02:20:55 PM
Check C::B's debug log for more information. Did you create a resource .zip with a manifest for the plugin?
There is no exception report (at least not in the /tmp where C::B usually puts them).
The resource .zip is there (you mean the MyPlugin.zip, I guess) and contains just the manifest
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_plugin_manifest_file>
<SdkVersion major="1" minor="11" release="8" />
<Plugin name="MyPlugin">
<Value title="MyPlugin" />
<Value version="0.1" />
<Value description="" />
<Value author="Georg-Johann Lay" />
<Value authorEmail="foo@bar.com" />
<Value authorWebsite="" />
<Value thanksTo="" />
<Value license="GPL" />
</Plugin>
</CodeBlocks_plugin_manifest_file>The plugin dir contains the .so as expected:
-rw-rw---- 1 georg users 520 2007-02-12 15:18 manifest.xml
-rw-rw---- 1 georg users 1086 2007-02-12 15:18 MyPlugin.cbp
-rw-rw---- 1 georg users 53482 2007-02-12 15:22 MyPlugin.cbplugin
-rw-rw---- 1 georg users 1697 2007-02-12 15:22 MyPlugin.cpp
-rw-rw---- 1 georg users 2292 2007-02-12 15:18 MyPlugin.h
-rwxrwx--- 1 georg users 160885 2007-02-12 15:22 MyPlugin.so
-rw-rw---- 1 georg users 406 2007-02-12 15:22 MyPlugin.zipQuote from: Pecan on February 12, 2007, 02:52:45 PM
http://forums.next.codeblocks.org/index.php?topic=4290.msg33916#msg33916
Plug-Ins : some suggested "case" conventions
Yes, I followed the case rules.
Quote from: stardust on February 12, 2007, 05:21:36 PM
There is no exception report (at least not in the /tmp where C::B usually puts them).
I refer to the "Code::Blocks Debug" tab of C::B's Messages panel. (If it doesn't appear, right-click one of the panel's tabs and select Code::Blocks Debug from the Show/Hide menu.)
Additionally, have you tried copying MyPlugin.zip to share/CodeBlocks and MyPlugin.so to share/CodeBlocks/plugins to see if your plugin works when loaded on startup?
copy the MyPlugin.so to the .../share/codeblocks/plugin directory
copy the MyPlugin.zip to the .../share/codeblocks directory
I've never used the Manage Plugin menu item. I don't know that it works. It says it's experimental.
Quote from: TDragon on February 12, 2007, 06:38:51 PMAdditionally, have you tried copying MyPlugin.zip to share/CodeBlocks and MyPlugin.so to share/CodeBlocks/plugins to see if your plugin works when loaded on startup?
I just tried it.
When I start C::B after that a message comes up from the system tray that reports an error durung startup of Code::Blocks and that there is an entry in the logs...
Now, were are these mysterious logs??? I cannot find them in the GUI, browsed the installation tree, looked in /tmp, searched the /var/log ...
Quote from: stardust on February 13, 2007, 03:12:53 PM
I cannot find them in the GUI
Quote from: TDragon on February 12, 2007, 06:38:51 PM
I refer to the "Code::Blocks Debug" tab of C::B's Messages panel. (If it doesn't appear, right-click one of the panel's tabs and select Code::Blocks Debug from the Show/Hide menu.)
If it isn't there, it may not appear in non-debug builds of C::B. (I don't know whether that's the case or not.) If it is there -- scroll upwards.
Quote from: TDragon on February 12, 2007, 06:38:51 PM
I refer to the "Code::Blocks Debug" tab of C::B's Messages panel. (If it doesn't appear, right-click one of the panel's tabs and select Code::Blocks Debug from the Show/Hide menu.)
Oh...sorry. I am not yet very familiar with C::B and these colors cannot be changed (must be somewhere in renderer?), changes to the syntax highlight scheme get lost upon a restart, etc. So blame me, I am still using emacs + console because of that...
(http://freenet-homepage.de/hightec-rt/svn-3596-colors.png)
Concerning the topic the debug log says
Quote
[15:55:32.132]: ERROR: SDK version mismatch for MyPlugin (1.11.5). Expecting 1.11.8
I updated to svn 3596 and did a rebuild and copied the filed again, but that does not fix it.
That message means either that the current C::B SDK version is 1.11.5 and your plugin's manifest reads 1.11.8, or that the current SDK version is 1.11.8 and your manifest reads 1.11.5. Likely the former; change your SdkVersion "release" attribute to 5.
As far as your loathsome colors go, many colors can be changed in the Environment and Editor settings, but the defaults should never be unreadable. You may want to consider poking around in your OS' visual settings, or even changing to a more mainstream distribution such as Ubuntu, Fedora Core, openSUSE, etc.
Quote from: TDragon on February 13, 2007, 04:51:27 PM
... change your SdkVersion "release" attribute to 5.
You mean the attribute in the manifest.xml? Changing that does not help. The error message is the same. And yes, I rebuilt the plugin and copied the stuff to them folders.
Quote from: TDragon on February 13, 2007, 04:51:27 PM
As far as your loathsome colors go, many colors can be changed in the Environment and Editor settings, but the defaults should never be unreadable. You may want to consider poking around in your OS' visual settings
I confirm with you. These colors *are* loathsome. C::B retains the envoronment colors but it does *not* retain the syntax highlight colors. (since several svn versions, I am still on 3596).
In the Management.Projects tab the headers and resouce file name's foreground colors are explicitely set to black without caring for contrast. For the tabs colors I changed the tabAreaColor and it's fine.
Is there a way to change the syntax highlighter's colors by hand in some file and copy it to a location where C::B looks for it on startup? That would be much less annoying then reentering all all these not-retained colors again and again...
Quote from: TDragon on February 13, 2007, 04:51:27 PM
, or even changing to a more mainstream distribution such as Ubuntu, Fedora Core, openSUSE, etc.
Yeah, I will bother my admin when I have some days left...
zip up your plugin source and .cbp files (or a minimal example that causes the problem).
Upload them to http://savefile.com, then paste the url here.
We'll have a look at it.
The archive is there. The sdk's subsubversion in manifelst.xml is changed by hand to "8" (was "5").
http://freenet-homepage.de/hightec-rt/MyPlugin.zip
Quote from: stardust on February 15, 2007, 10:17:12 AM
The archive is there. The sdk's subsubversion in manifelst.xml is changed by hand to "8" (was "5").
http://freenet-homepage.de/hightec-rt/MyPlugin.zip
Your plugin is NOT compiling. You should have told us of your errors.
The plugin wizard is producing an incorrect .cbp file.
Insert the following into Build Options/Search Directories
Re-compile, re-install. Note any compile errors.
(http://img243.imageshack.us/img243/341/142jm5.png)
QuoteThe plugin wizard is producing an incorrect .cbp file.
Insert the following into Build Options/Search Directories
Pecan, these are the old directories. The new ones use
include/ instead of
sdk/...
stardust: Since there have been changes made to the directory structure of the C::B sources recently, please make sure you're running and compiling against a version of Code::Blocks at or beyond revision 3604. Regenerate your plugin project and, if it still doesn't work, post the new sources.
As a side note: the manifests for C::B's standard plugins all use 1.10.0, so that's what I'd been using in my manifest.xml without problems.
QuoteAs a side note: the manifests for C::B's standard plugins all use 1.10.0, so that's what I'd been using in my manifest.xml without problems.
For the time being, the version number in the XML is not taken into account.
Quote from: mandrav on February 15, 2007, 03:30:04 PM
QuoteThe plugin wizard is producing an incorrect .cbp file.
Insert the following into Build Options/Search Directories
Pecan, these are the old directories. The new ones use include/ instead of sdk/...
Acknowledged
@Stardust,
Just make sure your compiler search directories point to the include files for where ever the sdk headers are on your codeblocks system.
You should be able to compile without errors (except for the pkg-config error, which I removed from my copy of your MyPlugin.cbp because it was producing incorrect results).
Quote from: Pecan on February 15, 2007, 03:24:06 PMYour plugin is NOT compiling. You should have told us of your errors.
Äh... The plugin project did compile without warnings and errors (svn 3596):
Quote-------------- Build: default in MyPlugin ---------------
Compiling: MyPlugin.cpp
Linking dynamic library: MyPlugin.so
Running target post-build steps
zip -j9 MyPlugin.zip manifest.xml
updating: manifest.xml (deflated 52%)
zip -j9 MyPlugin.cbplugin MyPlugin.so MyPlugin.zip
updating: MyPlugin.so (deflated 67%)
updating: MyPlugin.zip (deflated 8%)
Process terminated with status 0 (0 minutes, 5 seconds)
0 errors, 0 warnings
I now switched to svn 3615 and when I start c::b there is a "Global Variable Editor" dialog popping up for "cb" with the fields base, include, lib, obj, cflags, lflags. For "cb.base" I entered the c::b source folder, i.e. where bootstrap is located.
For "wx" I am clueless. I entered
wx.base=/usr
wx.include=include/wx-2.6
wx.lib=lib
Is that correct?
Building the MyPlugin yields the same as above: no errors, no warnings
restarting c::b, the error in the logs is still the same
[16:26:44.282]: ERROR: SDK version mismatch for MyPlugin (1.11.5). Expecting 1.11.8
Since the version in the manifest is being ignored, my next guess would be that you're compiling the plugin against a different version of C::B than the version you're trying to use the plugin with. Make sure that the version you compile against is the version you test with.
Quote from: TDragon on February 19, 2007, 04:42:13 PM
Make sure that the version you compile against is the version you test with.
There is only one instance (source and an installation generated from it) of c::b in my system so that should be ok. At the moment this is svn 3615.
The plugin's source directory is not located in the c::b plugins directory. Does that matter?
Quote from: stardust on February 19, 2007, 05:09:42 PM
The plugin's source directory is not located in the c::b plugins directory. Does that matter?
It shouldn't...
All I can say is make sure everything matches up. Ensure that the revision displayed on C::B's start page matches the revision shown by the "svn info" command. Delete your plugin .so and make sure that it's created where it should be when you compile it (so that you aren't inadvertently using an older version). Make sure you aren't mistakenly using an older version of C::B that's floating around on your system somewhere.
In my limited knowledge of the C::B sdk, the relevant areas of code appear to be sdk/pluginmanager.cpp in the PluginManager::RegisterPlugin function and include/cbplugin.h in PluginRegistrant's SDKVersion function. As far as I can see, your versions would only fail to match when the PLUGIN_SDK_VERSION_* constants change between revisions and you rebuild C::B but not your plugin, or vice versa.
Ok, I threw away all c::b sources, checked out svn 3627, rebuilt c::b from scratch, had the project wizard generated a brand new plugin "SecondPlugin", entered #cb and #wx stuff and built it:
Process terminated with status 0 (0 minutes, 5 seconds)
0 errors, 0 warnings
copied the files to the mentioned locations, quit and resterted c::b (the same as I generated the plugin with) and the problem is still the same:
[16:55:15.929]: ERROR: SDK version mismatch for SecondPlugin (1.11.5). Expecting 1.11.10
Are my settings of #cb and #wx correct?
SecondPlugin->Build Options->default->Search Directories->Compiler
$(#cb)/include
$(#wx.include)
$(#cb)/sdk/scintilla/include
SecondPlugin->Build Options->default->Search Directories->Linker
$(#cb)/lib
Anyway, as the project builds without errors (i.e. no missing include files, no unresolved references) these settings should do resp. are not used at all...
The SecondPlugin is there:
http://freenet-homepage.de/hightec-rt/SecondPlugin.zip
I did not change the sdk version entry in the manifest. Everything is untouched and comes right from c::b.
QuoteI did not change the sdk version entry in the manifest. Everything is untouched and comes right from c::b.
As stated above, the version in the manifest is currently ignored.
Anyway, the version number your plugin uses is "created" at compile-time with the help of the PluginRegistrant class (in cbPlugin.h). This uses the PLUGIN_SDK_VERSION_* macros (located in the same file). So, if your plugin is still built for the wrong SDK version, this can only mean one thing: you have installed the C::B SDK globally (e.g. /usr/include or /usr/local/include) and the compiler picks up that version, that is the wrong one.
So, uninstall any C::B headers from global dirs and rebuild your plugin. This will work.
*ARRGGH* (http://www.roboternetz.de/phpBB2/images/smiles/eusa_wall.gif)
Yes, there *were* remains from an ancient standard installation of c::b in
/usr/local/include/codeblocks and /opt/gnome/include/codeblocks.
Thanks!
Now it runs and says "Hello World!"!!!! :D
By the way...
why are crtn.o, crtbeginS.o etc. put into a .so?
Quote from: build log
gcc version 4.0.2 20050901 (prerelease) (SUSE Linux)
/usr/lib/gcc/i586-suse-linux/4.0.2/collect2 --eh-frame-hdr -m elf_i386 -shared -o ThirdPlugin.so /usr/lib/gcc/i586-suse-linux/4.0.2/../../../crti.o /usr/lib/gcc/i586-suse-linux/4.0.2/crtbeginS.o -L/local/install/codeblocks/lib -L/usr/lib -L/opt/gnome/lib -L/usr/X11R6/lib -L/usr/lib/gcc/i586-suse-linux/4.0.2 -L/usr/lib/gcc/i586-suse-linux/4.0.2 -L/usr/lib/gcc/i586-suse-linux/4.0.2/../../../../i586-suse-linux/lib -L/usr/lib/gcc/i586-suse-linux/4.0.2/../../.. .objs/ThirdPlugin.o -lcodeblocks -lwx_gtk2u_xrc-2.6 -lwx_gtk2u_qa-2.6 -lwx_gtk2u_html-2.6 -lwx_gtk2u_adv-2.6 -lwx_gtk2u_core-2.6 -lwx_baseu_xml-2.6 -lwx_baseu_net-2.6 -lwx_baseu-2.6 -lstdc++ -lm -lgcc_s -lpthread -lc -lgcc_s /usr/lib/gcc/i586-suse-linux/4.0.2/crtendS.o /usr/lib/gcc/i586-suse-linux/4.0.2/../../../crtn.o