Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development

HelloWorld plugin problems installing

(1/5) > >>

CrazyZ:
Hi guys,

I have just started getting into Code::Blocks and I really want to help contribute to this by creating plugins.  So I've started with the HelloWorld plugin, which I had some trouble with because it's a bit outdated.  So as soon as I can get his first plugin working, I'm going to update it.

Anyways, I've had quite a bit of problems actually getting this thing working.  I finally got it to compile correctly, but when I go to "Manage Plugins..." and "Install New", and select my .cbplugin.  But it just says "One or more plugins were not installed successfully..."

Anyways, the little pop-up at the bottom says I should check the application log... but it doesn't tell me where this log is located at all and I can't find it anywhere.

Can you guys help me out by telling me where to find out the application log?

thanks

Howard:

--- Quote from: CrazyZ on November 19, 2007, 01:59:05 am ---...
Anyways, the little pop-up at the bottom says I should check the application log... but it doesn't tell me where this log is located at all and I can't find it anywhere.

Can you guys help me out by telling me where to find out the application log?

thanks

--- End quote ---

If you have recently updated from svn, you may have to click menu/view/layouts/delete current.

That worked for me.

stahta01:
The lower window with build log and build messages; right click on its title bar and see if you can turn it on.

The last few builds, I think it might have been called "Code::Blocks" under toggle option.

Tim S

CrazyZ:
Thanks you guys so much for the quick reply.

I got this as the error message for the build:

C:\Program Files\Code Blocks/share/codeblocks/plugins/HelloWorld.dll: not loaded (missing symbols?)

Unfortunately, I don't understand what's going on because it compiled alright, so I would have though that all the symbols would have been taken care of?  I will post my code below:


--- Code: ---#include <sdk.h> // Code::Blocks SDK
#include <configurationpanel.h>
#include "HelloWorld.h"

#include <manager.h>
#include <logmanager.h>

// Register the plugin with Code::Blocks.
// We are using an anonymous namespace so we don't litter the global one.
namespace
{
    PluginRegistrant<HelloWorld> reg(_T("HelloWorld"));
}

// constructor
HelloWorld::HelloWorld()
{
    // Make sure our resources are available.
    // In the generated boilerplate code we have no resources but when
    // we add some, it will be nice that this code is in place already ;)
    if(!Manager::LoadResource(_T("HelloWorld.zip")))
    {
        NotifyMissingFile(_T("HelloWorld.zip"));
    }
}

// destructor
HelloWorld::~HelloWorld()
{
}

void HelloWorld::OnAttach()
{
    // do whatever initialization you need for your plugin
    // NOTE: after this function, the inherited member variable
    // m_IsAttached will be TRUE...
    // You should check for it in other functions, because if it
    // is FALSE, it means that the application did *not* "load"
    // (see: does not need) this plugin...
}

void HelloWorld::OnRelease(bool appShutDown)
{
    // do de-initialization for your plugin
    // if appShutDown is true, the plugin is unloaded because Code::Blocks is being shut down,
    // which means you must not use any of the SDK Managers
    // NOTE: after this function, the inherited member variable
    // m_IsAttached will be FALSE...
}

int HelloWorld::Execute()
{
    // do your magic ;
    if( !IsAttached() )
        return -1;
    Manager::Get()->GetLogManager()->Log( _("Hello World!") );
    return 0;
}

--- End code ---

Thanks guys again for helping out! :)

MortenMacFly:

--- Quote from: CrazyZ on November 20, 2007, 07:11:51 am ---Unfortunately, I don't understand what's going on because it compiled alright, so I would have though that all the symbols would have been taken care of?  I will post my code below:

--- End quote ---
I think you are missing to provide a (zipped) manifest.xml file for the plugin (and putting it into the right place). Look at other plugins how they do that... for example the envvars plugin. Notice the post build steps and that the zip archive has to have the same name as your plugin (case sensitive on linux). Anyways... it's really simple! :-)
With regards, Morten.

Navigation

[0] Message Index

[#] Next page

Go to full version