Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Plugins development => Topic started by: anandamu16 on February 07, 2017, 08:04:10 am

Title: hello word plugin install in codeblocks problem
Post by: anandamu16 on February 07, 2017, 08:04:10 am

I created the hello world plugin following this "http://wiki.codeblocks.org/index.php/Creating_a_simple_%22Hello_World%22_plugin".
After building up the plugin correctly, I go to settings->plugin->manage plugins-> Install new and then gave the helloworldplugin.cbp path.

But the popup says can't load your helloworldplugin. Any idea, whats the reason?

Tools used:
Codeblocks 16.01 IDE
Codeblocks src code from "http://codeblocks.org/downloads/25"       codeblocks_16.01.tar.gz
wxwidget2.8.12 (shared=1, monolithic=1, unicode=1, build= release as well as debug
Title: Re: hello word plugin install in codeblocks problem
Post by: oBFusCATed on February 07, 2017, 08:54:13 am
Something is not right with your symbols. Probably you're mixing compiler or libraries.
Title: Re: hello word plugin install in codeblocks problem
Post by: anandamu16 on February 07, 2017, 09:31:01 am
Quote
Something is not right with your symbols. Probably you're mixing compiler or libraries.

What do you mean by symbols? I rechecked the project settings and it seems all fine.
For the reference, i added screenshot of my project setings
Title: Re: hello word plugin install in codeblocks problem
Post by: BlueHazzard on February 07, 2017, 03:52:08 pm
by symbols he means the exported/imported function from dynamic/static libraries...
Your problem is probably that you are using two different compilers for the codeblocks libraries and your plugin libraries
or you are using two different sdks

Have you build codeblocks by yourself?
What compiler do you use?

Quote
After building up the plugin correctly, I go to settings->plugin->manage plugins-> Install new and then gave the helloworldplugin.cbp path.
is a plugin file generated?
Title: Re: hello word plugin install in codeblocks problem
Post by: anandamu16 on February 08, 2017, 07:01:10 am
Thanks BlueHazzard,

From your reply, I get an idea to make a plugin from the "codeblocks.exe" that I have generated on building sdk code.
I was successful to build the plugin and also succeeded to install it.

But I have some questions, If someone can answer:
1- Is it so, that if I want to build plugins for codeblocks. First I need to build codeblocks sdk to get Codeblocks.exe and then generate plugin through that codeblocks.exe only and then only those plugins can be successfully installed into this IDE. I mean to ask, if I download a Default codeblocks binary, Install it, Create a plugin and install it in the same IDE... is that possible?

2- In codeblocks svn source code, we have 2 files: One is "codeblocks.cbp" and other is "codeblocks.workspace". So If I want to build my separate version of codeblocks, I need to build only "codeblocks.cbp" or "codeblocks.workspace" also? and whats the difference in building both?
 

Quote
Have you build codeblocks by yourself?
Yes

Quote
What compiler do you use?
Mingw 5.3

Quote
is a plugin file generated?
Yes, all plugin files generated i.e; .cbplugin extension, zip file etc.

- Anand A.
Title: Re: hello word plugin install in codeblocks problem
Post by: stahta01 on February 08, 2017, 07:12:14 am

But I have some questions, If someone can answer:

2- In codeblocks svn source code, we have 2 files: One is "codeblocks.cbp" and other is "codeblocks.workspace". So If I want to build my separate version of codeblocks, I need to build only "codeblocks.cbp" or "codeblocks.workspace" also? and whats the difference in building both?
 
- Anand A.

The codeblocks.workspace builds the contrib plugins and likely builds the core plugins.
While "codeblocks.cbp" builds only the core plugins.

Tim S.
Title: Re: hello word plugin install in codeblocks problem
Post by: anandamu16 on February 08, 2017, 07:28:12 am
okey thanks.

Can you help to clear my doubt on plugin?
Quote
But I have some questions, If someone can answer:
1- Is it so, that if I want to build plugins for codeblocks. First I need to build codeblocks sdk to get Codeblocks.exe and then generate plugin through that codeblocks.exe only and then only those plugins can be successfully installed into this IDE. I mean to ask, if I download a Default codeblocks binary, Install it, Create a plugin and install it in the same IDE... is that possible?
Title: Re: hello word plugin install in codeblocks problem
Post by: BlueHazzard on February 08, 2017, 02:51:15 pm
The important things are that the compiler version of the codeblocks.exe, codeblocks.dll, wxWidgets.dll and your plugin dll are the same. This is because we use C++ as binding and for this the ABI has to be the same. This is "only" the case with the same compilers.

So the best ways to develop plugins is to compile codeblocks on your system and develop with this system. And for this (according to my opinion) the best way to distribute plugins is as source code.

IF you want to distribute your plugin as binary it would be the best to use the same compiler as the nightlys are build. You can look into this thread to get the information but probably it is some tdm gcc mingw
Title: Re: hello word plugin install in codeblocks problem
Post by: stahta01 on February 08, 2017, 05:20:21 pm
IF you want to distribute your plugin as binary it would be the best to use the same compiler as the nightlys are build. You can look into this thread to get the information but probably it is some tdm gcc mingw

From http://forums.codeblocks.org/index.php/topic,3299.0.html (http://forums.codeblocks.org/index.php/topic,3299.0.html)
Quote
15) all is now build with TDM-GCC 5.1.0, wxWidgets 2.8.12 (11 April 2016)
Therefor it is advised to also redownload the mingwm dll and the wx dll. Since these have also been rebuild with the TDM GCC 5.1.0 compiler (sjlj flavor).

http://wiki.codeblocks.org/index.php/Linking_the_plugin_to_a_Nightly_Build (http://wiki.codeblocks.org/index.php/Linking_the_plugin_to_a_Nightly_Build)

Tim S.
Title: Re: hello word plugin install in codeblocks problem
Post by: anandamu16 on February 09, 2017, 06:46:58 am
Thanks BlueHazzard for the help. I guess, I must use same compiler version everywhere.
Thanks Tim, for guiding. Anyway, I have followed that link a,ready but still I was not able to install my plugin in default codeblocks
Title: Re: hello word plugin install in codeblocks problem
Post by: stahta01 on February 09, 2017, 07:51:41 am

I created the hello world plugin following this "http://wiki.codeblocks.org/index.php/Creating_a_simple_%22Hello_World%22_plugin".
After building up the plugin correctly, I go to settings->plugin->manage plugins-> Install new and then gave the helloworldplugin.cbp path.

But the popup says can't load your helloworldplugin. Any idea, whats the reason?

Tools used:
Codeblocks 16.01 IDE
Codeblocks src code from "http://codeblocks.org/downloads/25"       codeblocks_16.01.tar.gz
wxwidget2.8.12 (shared=1, monolithic=1, unicode=1, build= release as well as debug

What was the extact name you entered? (It should normally end in something like cbplugin this is from memory NOT done a plugin install in a few month)

Tim S.
Title: Re: hello word plugin install in codeblocks problem
Post by: anandamu16 on February 09, 2017, 10:36:27 am
exact name was: helloworldplugin.cbplugin.

Sorry, Earlier I wrote it as helloworldplugin.cbp, My bad.
Title: Re: hello word plugin install in codeblocks problem
Post by: BlueHazzard on February 09, 2017, 02:17:14 pm
remember: if you change a compiling/linking command, or a compiler ALWAYS rebuild by Build->Clean and Build->Build or Build->Rebuild

Also i would clear manually old libraries from the installation folder of codeblocks