Code::Blocks Forums

User forums => Help => Topic started by: zemlinc on November 16, 2010, 05:59:46 pm

Title: Codeblocks compiled from source crashes with errors involving "GtkPizza"
Post by: zemlinc on November 16, 2010, 05:59:46 pm
Hi!

I am trying to create a new plugin for CodeBlocks, a new widget for wxsmith.  I understand that for this I need to compile codeblocks and wxwidgets from sources.  I did this, the compilation went without errors, but when start Codeblocks, I get the following output:

christian@christian-laptop:~/projects/devel/src/codeblocks-10.05$ codeblocks
Initialize EditColourSet .....
Initialize EditColourSet: done.
Loading toolbar...
MouseSap: loaded
BrowseTracker: loaded
wxSmithContribItems: loaded
MouseSap plugin activated
BrowseTracker plugin activated
wxSmith - Contrib Items plugin activated
Initializing plugins...

(codeblocks:12913): GLib-GObject-WARNING **: cannot register existing type `GtkPizza'

(codeblocks:12913): GLib-GObject-WARNING **: invalid cast from `GtkPizza' to `<invalid>'

(codeblocks:12913): GLib-GObject-WARNING **: cannot register existing type `GtkPizza'

(codeblocks:12913): GLib-GObject-WARNING **: invalid cast from `GtkPizza' to `<invalid>'

(codeblocks:12913): GLib-GObject-WARNING **: cannot register existing type `GtkPizza'

(codeblocks:12913): GLib-GObject-WARNING **: invalid cast from `GtkPizza' to `<invalid>'

(codeblocks:12913): GLib-GObject-WARNING **: cannot register existing type `GtkPizza'

(codeblocks:12913): GLib-GObject-WARNING **: invalid cast from `GtkPizza' to `<invalid>'

(codeblocks:12913): GLib-GObject-WARNING **: cannot register existing type `GtkPizza'

(codeblocks:12913): GLib-GObject-WARNING **: invalid cast from `GtkPizza' to `<invalid>'

(codeblocks:12913): GLib-GObject-WARNING **: cannot register existing type `GtkPizza'

(codeblocks:12913): GLib-GObject-WARNING **: invalid cast from `GtkPizza' to `<invalid>'

(codeblocks:12913): GLib-GObject-WARNING **: cannot register existing type `GtkPizza'

(codeblocks:12913): GLib-GObject-WARNING **: invalid cast from `GtkPizza' to `<invalid>'
Aborted
christian@christian-laptop:~/projects/devel/src/codeblocks-10.05$

I am using:
Ubuntu 10.10
Codeblocks-10.05 (configured with the option --with-contrib-plugins=all)
wxGTK-2.8.11

I would greatly appreciate your help!
Title: Re: Codeblocks compiled from source crashes with errors involving "GtkPizza"
Post by: oBFusCATed on November 16, 2010, 07:23:36 pm
Try starting codeblocks with gdb or valgrind
Title: Re: Codeblocks compiled from source crashes with errors involving "GtkPizza"
Post by: zemlinc on November 16, 2010, 08:34:54 pm
Try starting codeblocks with gdb or valgrind

Thank you for the suggestion.  Below is the output when I start codeblocks with gdb.
Please let me know what you think!

Christian

christian@christian-laptop:~/projects/devel/src$ gdb codeblocks
GNU gdb (GDB) 7.2-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/local/bin/codeblocks...done.
(gdb) run
Starting program: /usr/local/bin/codeblocks
[Thread debugging using libthread_db enabled]
Initialize EditColourSet .....
[New Thread 0x7fffec2aa710 (LWP 3349)]
[New Thread 0x7fffebaa9710 (LWP 3350)]
[New Thread 0x7fffeb2a8710 (LWP 3351)]
[New Thread 0x7fffeaaa7710 (LWP 3352)]
Initialize EditColourSet: done.
Loading toolbar...
MouseSap: loaded
BrowseTracker: loaded
wxSmithContribItems: loaded
MouseSap plugin activated
BrowseTracker plugin activated
wxSmith - Contrib Items plugin activated
Initializing plugins...

(codeblocks:3125): GLib-GObject-WARNING **: cannot register existing type `GtkPizza'

(codeblocks:3125): GLib-GObject-WARNING **: invalid cast from `GtkPizza' to `<invalid>'

(codeblocks:3125): GLib-GObject-WARNING **: cannot register existing type `GtkPizza'

(codeblocks:3125): GLib-GObject-WARNING **: invalid cast from `GtkPizza' to `<invalid>'

(codeblocks:3125): GLib-GObject-WARNING **: cannot register existing type `GtkPizza'

(codeblocks:3125): GLib-GObject-WARNING **: invalid cast from `GtkPizza' to `<invalid>'

(codeblocks:3125): GLib-GObject-WARNING **: cannot register existing type `GtkPizza'

(codeblocks:3125): GLib-GObject-WARNING **: invalid cast from `GtkPizza' to `<invalid>'

(codeblocks:3125): GLib-GObject-WARNING **: cannot register existing type `GtkPizza'

(codeblocks:3125): GLib-GObject-WARNING **: invalid cast from `GtkPizza' to `<invalid>'

(codeblocks:3125): GLib-GObject-WARNING **: cannot register existing type `GtkPizza'

(codeblocks:3125): GLib-GObject-WARNING **: invalid cast from `GtkPizza' to `<invalid>'

(codeblocks:3125): GLib-GObject-WARNING **: cannot register existing type `GtkPizza'

(codeblocks:3125): GLib-GObject-WARNING **: invalid cast from `GtkPizza' to `<invalid>'

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff6fa182c in wxBaseArrayInt::Add(int, unsigned long) ()
   from /opt/wx/2.8/lib/libwx_gtk2u-2.8.so.0

(gdb) where
#0  0x00007ffff6fa182c in wxBaseArrayInt::Add(int, unsigned long) ()
   from /opt/wx/2.8/lib/libwx_gtk2u-2.8.so.0
#1  0x00007fffe56161c3 in wxsRegisterItem<wxsSpacer>::~wxsRegisterItem() ()
   from /usr/lib/libwxsmithlib.so.0
#2  0x00007ffff5d7e4f2 in __run_exit_handlers (status=0) at exit.c:78
#3  exit (status=0) at exit.c:100
#4  0x00007ffff5d63d95 in __libc_start_main (main=<value optimized out>,
    argc=<value optimized out>, ubp_av=<value optimized out>,
    init=<value optimized out>, fini=<value optimized out>,
    rtld_fini=<value optimized out>, stack_end=0x7fffffffe248)
    at libc-start.c:258
#5  0x000000000042e539 in _start ()
(gdb)
Title: Re: Codeblocks compiled from source crashes with errors involving "GtkPizza"
Post by: stahta01 on November 16, 2010, 09:06:26 pm
What does "wx-config --prefix" return?


Per
http://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Linux

Tim S.
Title: Re: Codeblocks compiled from source crashes with errors involving "GtkPizza"
Post by: Jenna on November 16, 2010, 09:26:27 pm
Why do you use a self-compiled wxWidgets ?
I suggest to use the packages provided by ubuntu and try it again.
Title: Re: Codeblocks compiled from source crashes with errors involving "GtkPizza"
Post by: zemlinc on November 16, 2010, 10:09:07 pm
What does "wx-config --prefix" return?


Per
http://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Linux

Tim S.


wx-config --prefix returns:

/opt/wx/2.8

(This is the directory where I have the wx sources).

Christian
Title: Re: Codeblocks compiled from source crashes with errors involving "GtkPizza"
Post by: zemlinc on November 16, 2010, 10:11:23 pm
Why do you use a self-compiled wxWidgets ?
I suggest to use the packages provided by ubuntu and try it again.


I use self-compiled wxWidgets because I read in a tutorial
(http://wiki.codeblocks.org/index.php/Creating_a_simple_%22Hello_World%22_plugin)
that you have to compile your own wxWidgets from source in order to make a plugin.  Do you think this is not true?

Title: Re: Codeblocks compiled from source crashes with errors involving "GtkPizza"
Post by: Jenna on November 16, 2010, 10:34:43 pm
Yes it's not true (except on windows).
The top of the wiki-article tells you, that it is outfdated and needs to be updated.

On linux it is enough to install the development packages of wxWidgets and if you have C::B packages that work on your distro, you should be abale to use the development packages of C::B and wxSmith to create a plugin.
Ubuntu 10.10 includes C::B 10.05 as far as I know, and if they use the actual package layout, there should be dev-packages also.

codeblocks-dev and wxsmith-dev (and their dependencies) for C::B and libwxgtk2.8-dev (and it's dependencies) should be enough.

You can use pkg-config for codeblocks and wxsmith (if the dev packages are installed).
Title: Re: Codeblocks compiled from source crashes with errors involving "GtkPizza"
Post by: zemlinc on November 17, 2010, 03:43:32 am
Yes it's not true (except on windows).
The top of the wiki-article tells you, that it is outfdated and needs to be updated.

On linux it is enough to install the development packages of wxWidgets and if you have C::B packages that work on your distro, you should be abale to use the development packages of C::B and wxSmith to create a plugin.
Ubuntu 10.10 includes C::B 10.05 as far as I know, and if they use the actual package layout, there should be dev-packages also.

codeblocks-dev and wxsmith-dev (and their dependencies) for C::B and libwxgtk2.8-dev (and it's dependencies) should be enough.

You can use pkg-config for codeblocks and wxsmith (if the dev packages are installed).

Thank you for your explanation.
I removed my self-compiled CodeBlocks and wxSmith and reinstalled them from the Ubuntu repositories, as you suggested.
I can now compile and install a minimal (empty) CodeBlocks plugin, following the instructions of the outdated webpage I quoted.
When I try, however, to make a new widget for wxsmith, following this tutorial,

http://wiki.codeblocks.org/index.php?title=Creating_a_plugin_which_adds_new_item_into_wxSmith

it compiles, but when I try to install it gives the error message:

One or more plugins were not loaded.  This usually happens when a plugin is built for a different version of the Code::Blocks SDK.  Check the application log for more info.

Any ideas what is going wrong now?  Or where I can find the application log?

Thank you very much for your help,

Christian


Title: Re: Codeblocks compiled from source crashes with errors involving "GtkPizza"
Post by: Jenna on November 17, 2010, 08:04:17 am
Make sure that the name of the created library (without the ending) is the same as the name of the zip-file (without the ending) and the registered name.
And be aware that it is case sensitive !