Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: utku on January 25, 2006, 03:58:32 pm

Title: plugin development
Post by: utku on January 25, 2006, 03:58:32 pm
Hi all,

I am looking for tutorials or howto's  regarding to plugin development. Actually I am considering writing a navigator plugin for code editor which makes it possible to move between definition and declerations, allows user to put landmarks on the code etc. But I am not sure if I can so want to play around a bit.
Title: Re: plugin development
Post by: mandrav on January 25, 2006, 04:03:26 pm
Look at Developing for Code::Blocks (http://wiki.codeblocks.org/index.php?title=Developing_for_Code::Blocks) wiki section.
Title: Re: plugin development
Post by: utku on January 25, 2006, 04:15:36 pm
upss, I didn't notice wiki, thanks
Title: Re: plugin development
Post by: utku on January 25, 2006, 05:12:55 pm
I have compiled helloworld plugin but the DLL can not be loaded on start and throws an exception telling an entry function in codeblocks.dll regarding to loggin is not found. I am using nightly buid, is there a possiblity of a problem becouse of the SDK/example date?
Title: Re: plugin development
Post by: AkiraDev on January 25, 2006, 09:33:58 pm
I have compiled helloworld plugin but the DLL can not be loaded on start and throws an exception telling an entry function in codeblocks.dll regarding to loggin is not found. I am using nightly buid, is there a possiblity of a problem becouse of the SDK/example date?

If you are using a downloaded SDK, it will probably be the SDK for RC2. This is by far no longer compatible with any nightly build. In order for linkage to be possible between your plugin and codeblocks.dll, they need to originate from the same source code and be compiled with the same settings. I would therefore advise you to consider getting the latest SVN revision (you can find instructions for this at the home page) and compile Code::Blocks, as this will make sure any plugin you build from whithin your environment is compatible with your Code::Blocks binary.

It would take more effort, but I can tell you that it pays. Not only are linkage problems eliminated, but being able to browse the source code of the application you're writing a plugin for is a HUGE help.

Good Luck :)
Title: Re: plugin development
Post by: severach on January 26, 2006, 03:22:31 am
Has anyone considered making a C only plugin interface so it will be compatible across version, builds, and compilers? A C++ interface may be handy for rapid development but it will be forever plagued with compatibility problems which will limit plugin availability to only those built regularly by the Code::Blocks team. Private plugins would require constant rebuilds and commercial plugins are infeasible.

A C interface would be a bit more efficient too.

Scintilla is C ready already.
Title: Re: plugin development
Post by: Ceniza on January 26, 2006, 03:44:43 am
Having a C only plugin wouldn't make much sense since most of Code::Blocks is written in C++ (¿SDK 100% C++?) and also wxWidgets. It would be very problematic to get a C plugin showing a configuration dialog, adding a toolbar, a menu, and interfacing with everything in the SDK. It'd need to be some kind of hack.

I think it's easier to just rebuild the plugin :)
Title: Re: plugin development
Post by: utku on January 26, 2006, 06:24:56 am
well, I have installed SVN, downloaded current 1863, recompiled wx to support unicode, and finally compiled c::b without major problems but when I run the executable it crashes instantly. I do not have a clue about this. :(
Title: Re: plugin development
Post by: AkiraDev on January 26, 2006, 10:33:24 am
well, I have installed SVN, downloaded current 1863, recompiled wx to support unicode, and finally compiled c::b without major problems but when I run the executable it crashes instantly. I do not have a clue about this. :(

Incompatibilities between C::B and some old plugins may cause it to crash in some cases. You probably just took the first step which is building C::B itself. After you built the C::B main program and core plugins, open the ContribPlugins.Workspace file, which contains the community contributed plugins. Build this workspace and if everything went fine, go to the directory where you have the C::B source. You should see the update.bat batch file there. Execute it. You should have a final version of all your binaries inside the "output" directory.

HTH
Title: Re: plugin development
Post by: tiwag on January 26, 2006, 11:20:02 am
well, I have installed SVN, downloaded current 1863, recompiled wx to support unicode, and finally compiled c::b without major problems but when I run the executable it crashes instantly. I do not have a clue about this. :(

did you run src/update.bat ? (for Windows builds) before running the codeblocks.exe
this is necessary to create all the directories with resources
Title: Re: plugin development
Post by: utku on January 26, 2006, 05:10:13 pm
After compiling plugins and using update.bat I got it working. Thanks :)