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

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: Getting started with plugins
« Reply #15 on: February 15, 2007, 03:37:03 pm »
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.
« Last Edit: February 15, 2007, 03:38:58 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 mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Getting started with plugins
« Reply #16 on: February 15, 2007, 04:03:33 pm »
Quote
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.

For the time being, the version number in the XML is not taken into account.
Be patient!
This bug will be fixed soon...

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: Getting started with plugins
« Reply #17 on: February 15, 2007, 04:26:07 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/...

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).
« Last Edit: February 15, 2007, 04:28:53 pm by Pecan »

Offline stardust

  • Multiple posting newcomer
  • *
  • Posts: 55
    • http://www.hightec-rt.com
Re: Getting started with plugins
« Reply #18 on: February 19, 2007, 04:15:29 pm »
Your 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
Code
-------------- 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
Code
[16:26:44.282]: ERROR: SDK version mismatch for MyPlugin (1.11.5). Expecting 1.11.8
« Last Edit: February 19, 2007, 04:28:53 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 #19 on: February 19, 2007, 04:42:13 pm »
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.
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 #20 on: February 19, 2007, 05:09:42 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?
« Last Edit: February 19, 2007, 05:12:09 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 #21 on: February 19, 2007, 05:22:23 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.
« Last Edit: February 19, 2007, 05:29:36 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 #22 on: February 20, 2007, 05:21:14 pm »
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:

Code
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:

Code
[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.
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 mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Getting started with plugins
« Reply #23 on: February 20, 2007, 05:46:26 pm »
Quote
I 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.
Be patient!
This bug will be fixed soon...

Offline stardust

  • Multiple posting newcomer
  • *
  • Posts: 55
    • http://www.hightec-rt.com
Re: Getting started with plugins
« Reply #24 on: February 21, 2007, 05:40:13 pm »
*ARRGGH*

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