Page 1 of 1

Creating a CodeLite plugin

Posted: Wed Oct 26, 2016 6:19 am
by CireSnave
Hello All,

Today I decided to try my hand at making a CodeLite plugin. I pulled up the page describing creating a plugin (http://codelite.org/Developers/CreatePlugin) and used the wizard to create the skeleton of a plugin. I made the wizard create it under my CodeLite source directory as the web page said that was easier. I worked my way all the way through the wizard as I also followed along on that web page and got to the end where it describes adding the add_subdirectory statement to the top level CMakeLists.txt file. First issue here...it says to add it somewhere near the bottom. Does that mean AT the bottom? Within one of the sections above there that has other add_subdirectory statements? It really doesn't say so I tried putting it just below the last add_subdirectory statement in the file. Anywho. When I go to remake CodeLite it comes back with: /home/ciresnave/codelite/codelite-9.2/WizardTree/wizardtree.cpp:23:12: error: could not convert ‘& info’ from ‘PluginInfo*’ to ‘PluginInfo’

Now, that looks like it would be an easy fix. Someone might have typoed in when they created the wizard and had it return the address of a PlugInInfo instead of the PlugInInfo itself. Thinking that I went into my source and removed the &. It now compiles fine. However, now when I launch CodeLite it crashes with a SIGABRT in GetPluginInfo(). I'm guessing this is my error somehow but I've read through the web page again and looked at the code til my head is spinning. What am I missing?

- CireSnave

Re: Creating a CodeLite plugin

Posted: Wed Oct 26, 2016 11:55 am
by eranif
CireSnave wrote:could not convert ‘& info’ from ‘PluginInfo*’ to ‘PluginInfo’
This one was fixed couple of weeks ago

After the build is complete, remember to run "make install"
It is always recommended to build CodeLite sources in debug mode.
So basically, you should:

* Build CodeLite in debug mode, see: http://codelite.org/Developers/Linux#toc5
* Once "make install" is completed, run CodeLite under gdb, like this:

Code: Select all

gdb /home/<USERNAME>/root/bin/codelite
and see why it crashes

Re: Creating a CodeLite plugin

Posted: Fri Oct 28, 2016 2:27 am
by CireSnave
Alright. It seems my issue was with where I pulled the CodeLite source from. I had originally pulled source from the codelite.org repository for Yaketty which was apparently a bad idea. I cloned the GIT repository instead and recreated my little plugin that does nothing under that and after compiling and installing everything again 1) it didn't complain about the pointer and 2) it didn't crash on launch. However, it appears that installing that compiled version of CodeLite overwrote the CodeLite I already had on my system which wouldn't have been a problem except that it now does not have the wxCrafter plugin. Now, if wxCrafter is the only acceptable way to do GUI work for a plugin and I have to compile and install CodeLite to build and install my plugin how do I then continue my plugin development work? Am I forced to use the standalone wxCrafter? I've tried reinstalling both of the versions of wxCrafter that are precompiled for Yaketty with no luck on either one. I've tried putting the library and zip file for wxCrafter that are listed at the bottom of the Repositories info page (http://codelite.org/LiteEditor/Repositories) with no luck. Is there no way to make wxCrafter work as a plugin with CodeLite 9.2.6? Did I miss something? Am I just stuck using the standalone version of wxCrafter since I'm playing on the bleeding edge (newest code from git)?

- CireSnave

Re: Creating a CodeLite plugin

Posted: Fri Oct 28, 2016 1:50 pm
by DavidGH
Hi,

One solution, that sounds complicated but should be easy in practice, is:
1) Install the yakkety CodeLite and wxCrafter.
2) Build your plugin using the git CodeLite but, when you build, pass the 'PREFIX=' option to cmake. That will install CodeLite to a separate location, so the two versions won't clash.
3) When you start a git CodeLite instance, you may wish to pass the --datadir= option so that a different .codelite is used.

I have a bash alias (and others for 'config & build without clean' and 'just rebuild') that you could adapt. You'll see it builds in a subdir called build-dbg (which you should create first) and installs to ./CL-install.
alias CLcleanbuild='(\cd build-dbg/ && make clean && rm -f CMakeCache.txt && cmake -G "Unix Makefiles" VERBOSE=1 -DCMAKE_BUILD_TYPE=DebugFull -DPREFIX=$(pwd)/../CL-install .. && make -j8 && make install)'

With that setup you can run the yakkety CodeLite/wxCrafter and create a workspace for the git Codelite (or open the official one). You should then be able to use that wxCrafter for the gui, but build and test your plugin with the git instance.

Regards,

David

Re: Creating a CodeLite plugin

Posted: Sat Oct 29, 2016 8:40 am
by CireSnave
Thank you very much David. That should work very well as a work around for this issue. Now I can get back to the fun of building a plugin.

- CireSnave