Author Topic: Getting started with plugins [resolved]  (Read 18591 times)

Offline stardust

  • Multiple posting newcomer
  • *
  • Posts: 55
    • http://www.hightec-rt.com
Getting started with plugins [resolved]
« on: February 12, 2007, 11:47:24 am »
To create my first plugin I followed the hints in 'Creating a simple "Hello World" plugin'.

The tutorial is outdated, so I added the following paths

Build options -> Search directories -> Compiler
Code
<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
Code
<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



« Last Edit: March 01, 2007, 03:23:34 pm by stardust »
Own SVN builds (quite new) • SuSE Linux 10.0 • Linux kernel 2.6.13-15-default
gcc 4.0.2 (20050901)
wxGTK-2.6.1.0-4 • KDE 3.4.2b • gtk2 2.8.3-4

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: Getting started with plugins
« Reply #1 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?
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2775
Re: Getting started with plugins
« Reply #2 on: February 12, 2007, 02:52:45 pm »

Offline stardust

  • Multiple posting newcomer
  • *
  • Posts: 55
    • http://www.hightec-rt.com
Re: Getting started with plugins
« Reply #3 on: February 12, 2007, 05:21:36 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
Code
<?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:

Code
-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.zip

http://forums.codeblocks.org/index.php?topic=4290.msg33916#msg33916
Plug-Ins : some suggested "case" conventions

Yes, I followed the case rules.
Own SVN builds (quite new) • SuSE Linux 10.0 • Linux kernel 2.6.13-15-default
gcc 4.0.2 (20050901)
wxGTK-2.6.1.0-4 • KDE 3.4.2b • gtk2 2.8.3-4

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: Getting started with plugins
« Reply #4 on: February 12, 2007, 06:38:51 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?
« Last Edit: February 12, 2007, 06:43:38 pm by TDragon »
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2775
Re: Getting started with plugins
« Reply #5 on: February 12, 2007, 07:20:34 pm »
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.


Offline stardust

  • Multiple posting newcomer
  • *
  • Posts: 55
    • http://www.hightec-rt.com
Re: Getting started with plugins
« Reply #6 on: February 13, 2007, 03:12:53 pm »
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?

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 ...
Own SVN builds (quite new) • SuSE Linux 10.0 • Linux kernel 2.6.13-15-default
gcc 4.0.2 (20050901)
wxGTK-2.6.1.0-4 • KDE 3.4.2b • gtk2 2.8.3-4

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: Getting started with plugins
« Reply #7 on: February 13, 2007, 03:21:04 pm »
I cannot find them in the GUI
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.
« Last Edit: February 13, 2007, 03:22:35 pm by TDragon »
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

Offline stardust

  • Multiple posting newcomer
  • *
  • Posts: 55
    • http://www.hightec-rt.com
Re: Getting started with plugins
« Reply #8 on: February 13, 2007, 04:05:46 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...





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.
Own SVN builds (quite new) • SuSE Linux 10.0 • Linux kernel 2.6.13-15-default
gcc 4.0.2 (20050901)
wxGTK-2.6.1.0-4 • KDE 3.4.2b • gtk2 2.8.3-4

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: Getting started with plugins
« Reply #9 on: February 13, 2007, 04:51:27 pm »
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.
« Last Edit: February 13, 2007, 04:58:43 pm by TDragon »
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

Offline stardust

  • Multiple posting newcomer
  • *
  • Posts: 55
    • http://www.hightec-rt.com
Re: Getting started with plugins
« Reply #10 on: February 14, 2007, 10:30:41 am »
... 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.

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...

, 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...
Own SVN builds (quite new) • SuSE Linux 10.0 • Linux kernel 2.6.13-15-default
gcc 4.0.2 (20050901)
wxGTK-2.6.1.0-4 • KDE 3.4.2b • gtk2 2.8.3-4

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2775
Re: Getting started with plugins
« Reply #11 on: February 14, 2007, 03:04:15 pm »
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.

 

Offline stardust

  • Multiple posting newcomer
  • *
  • Posts: 55
    • http://www.hightec-rt.com
Re: Getting started with plugins
« Reply #12 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
Own SVN builds (quite new) • SuSE Linux 10.0 • Linux kernel 2.6.13-15-default
gcc 4.0.2 (20050901)
wxGTK-2.6.1.0-4 • KDE 3.4.2b • gtk2 2.8.3-4

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2775
Re: Getting started with plugins
« Reply #13 on: February 15, 2007, 03:24:06 pm »

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.



Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Getting started with plugins
« Reply #14 on: February 15, 2007, 03:30:04 pm »
Quote
The 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/...
Be patient!
This bug will be fixed soon...