codeblocs error after upgrading to Ubuntu Karmic


i just upgraded to karmic and now i get this when i run codeblocks.

$ codeblocks
codeblocks: relocation error: /usr/lib/ symbol _Z18wxSafeConvertWX2MBPKw, version WXU_2.8.2 not defined in file with link time reference

i have resintalled codeblocks with the OF ubuntu script and with aptitude with same result.

is anyone having similar issues? The error seems to come from wxwidgets.



just posted this in another thread, but just in case:

yes the install_codeblocks script is broken in karmic.the wx-widgets repositories are not updated frequently for ubuntu but normally it worked with hardy. here’s a new one that checks what repositories are available and chooses the newest one although just changing to jaunty is enough.

also you’re going to get an error with the libraries module in codeblocks:

the problem with the libraries is actually a problem with the output in pkg-config. try:

pkg-config --list-all

surely you will get an error at the end of the list. codeblocks is parsing that output and gets confused by it. normally the error is related to some missing packages. in a fresh install of karmic i’m getting:

Package libdrm was not found in the pkg-config search path.

so to solve it:

sudo apt-get install libdrm-dev

same problem

$ codeblocks
codeblocks: relocation error: /usr/lib/ symbol _Z18wxSafeConvertWX2MBPKw, version WXU_2.8.2 not defined in file with link time reference

I did pkg-config --list-all and yes the problem with libdrm was there this was solved by installing libdrm-dev, then i downloaded and run the install codeblocks script but i get the same problem. I removed codeblocks and run again the script just in case.

— edit —

this is the output of the scripts just in case. but everything seems normal to me. maybe i have to reinstall wx

$ sudo ./
Hit karmic Release.gpg
Hit karmic-security Release.gpg
Ign karmic-security/main Translation-en_GB
Ign karmic-security/restricted Translation-en_GB
Hit karmic Release.gpg
Ign karmic/partner Translation-en_GB
Ign karmic-security/universe Translation-en_GB
Ign karmic-security/multiverse Translation-en_GB
Hit karmic-security Release
Ign karmic/universe Translation-en_GB
Hit karmic Release
Hit karmic-security/main Packages
Hit karmic/partner Packages
Hit karmic-security/restricted Packages
Hit karmic-security/main Sources
Hit karmic-security/restricted Sources
Hit karmic-security/universe Packages
Hit karmic/partner Sources
Hit karmic-security/universe Sources
Hit karmic-security/multiverse Packages
Hit karmic-security/multiverse Sources
Hit karmic Release
Hit karmic/universe Packages
Hit jaunty-wx Release.gpg
Ign jaunty-wx/main Translation-en_GB
Hit jaunty-wx Release
Hit karmic Release.gpg
Hit jaunty-wx/main Packages
Get: 1 karmic/main Translation-en_GB [63.7kB]
Get: 2 karmic/restricted Translation-en_GB [3,402B]
Get: 3 karmic/universe Translation-en_GB [33.2kB]
Get: 4 karmic/multiverse Translation-en_GB [43.8kB]
Hit karmic-updates Release.gpg
Ign karmic-updates/main Translation-en_GB
Ign karmic-updates/restricted Translation-en_GB
Ign karmic-updates/universe Translation-en_GB
Ign karmic-updates/multiverse Translation-en_GB
Hit karmic-backports Release.gpg
Ign karmic-backports/main Translation-en_GB
Ign karmic-backports/restricted Translation-en_GB
Ign karmic-backports/universe Translation-en_GB
Ign karmic-backports/multiverse Translation-en_GB
Hit karmic-proposed Release.gpg
Ign karmic-proposed/restricted Translation-en_GB
Ign karmic-proposed/main Translation-en_GB
Ign karmic-proposed/multiverse Translation-en_GB
Ign karmic-proposed/universe Translation-en_GB
Hit karmic Release
Hit karmic-updates Release
Hit karmic-backports Release
Hit karmic-proposed Release
Hit karmic/main Packages
Hit karmic/restricted Packages
Hit karmic/main Sources
Hit karmic/restricted Sources
Hit karmic/universe Packages
Hit karmic/universe Sources
Hit karmic/multiverse Packages
Hit karmic/multiverse Sources
Hit karmic-updates/main Packages
Hit karmic-updates/restricted Packages
Hit karmic-updates/main Sources
Hit karmic-updates/restricted Sources
Hit karmic-updates/universe Packages
Hit karmic-updates/universe Sources
Hit karmic-updates/multiverse Packages
Hit karmic-updates/multiverse Sources
Hit karmic-backports/main Packages
Hit karmic-backports/restricted Packages
Hit karmic-backports/universe Packages
Hit karmic-backports/multiverse Packages
Hit karmic-proposed/restricted Packages
Hit karmic-proposed/main Packages
Hit karmic-proposed/multiverse Packages
Hit karmic-proposed/universe Packages
Fetched 144kB in 28s (5,006B/s)
Reading package lists… Done
Reading package lists… Done
Building dependency tree
Reading state information… Done
libcodeblocks0 is already the newest version.
codeblocks is already the newest version.
libwxsmithlib0 is already the newest version.
codeblocks-contrib is already the newest version.
libwxgtk2.8-0 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 13 not upgraded.

ok i solved it. i started up synaptic and saw there were two wxwidgets packages to be upgraded. When I tried to upgrade them there was an error with python-wxgtk package

E: /var/cache/apt/archives/python-wxgtk2.8_2.8.10.1-1_i386.deb: trying to overwrite ‘/usr/share/pyshared/wx-2.8-gtk2-unicode/’, which is also in package python-wxversion 0

I tried few things with no luck, i am not good at this package installing science :wink: So I ended up trying to install it with aptitude which sometimes seems to deal better with this kind of problems, and this worked. So now CodeBlocks is up and runnign again.


I followed arturo’s instructions and ran

sudo apt-get install libdrm-dev  

followed by running the new script. This resulted in the same error altern had, doing the following fixed it:

sudo apt-get update  
sudo apt-get upgrade  

this then installed the libwxgtk2.8-0 package which then enabled codeblocks to run.

However now I’m having problems both with the movieGrabberExample and moviePlayerExample. The grabber fails to find my build in camera (probably identical to yours arturo), and the file plays, but the output looks corrupted and it eventually segfauls. I can run cheese successfully, haven’t tried ucview.

The grabber fails to find my build in camera (probably identical to yours arturo

my computer died so can’t try with that camera : (

are you trying with unicap or gstreamer?

i’ve found a problem with the videoplayer in karmic as by default gstreamer uses now rgba, so you need to specify the depth in the pipeline. i have it working. going to pack it and upload it.

my codeblocks even didn’t start after i installed a fresh karmic 32bit.

this solved my problem:

just add deb jaunty-wx main
to your software soruces and do a update & upgrade.

got it from here:…-1.msg77976


the problem is that da still want to install the old hardy stuff:
line from the file:
WX_DEB=“deb hardy-wx main”


just got some errors with my fresh installation:
i also need the libunicap-dev package and the gstreamer0.10-ffmpeg package to start the movieplayer example.
i think you should add this to the script or think about to change to a more free video format?!

benben, you will find that arturo already included a new codeblocks install script in this thread which fixes that problem.

i’m sorry, didn’t noticed that one. but its good when its already fixed! :slight_smile:

I just upgrade some packages and I’m getting this error again:

relocation error: /usr/lib/ symbol _Z18wxSafeConvertWX2MBPKw, version WXU_2.8 not defined in file with link time reference

Can’t seem to fix it this time…I think I’m going to have to compile CB from source which is annoying. Looks like codeblocks is not up to date with the latest wxwidgets library in Karmic.

try in synaptic preferences > distribution: always prefer: jaunty-wx

that will make all wx-widgets related packages to be installed from the wx repositories instead of the ubuntu one.

then update & upgrade to change the packages to the original ones.

i’m looking for a way of doing this automatically from the script

I switched to wx-jaunty in Synaptic > Settings > Preferences > Distribution > ‘Prefer versions from’… ran sudo apt-get update then sudo apt-get upgrade, and no luck. It doesn’t seem to think anything needs upgrading. Same if I run or sudo apt-get install libdrm-dev - it thinks everything already has the latest versions, so it doesn’t need to worry.

(still get the same error when I run codeblocks)

Unfortunately that didn’t work for me either…I had to install codeblocks from source.

same for me. tried arturo’s workaround, but that didn’t help, too :frowning:


see the karmic thread

You mean this thread?

…Still getting the same

codeblocks: relocation error: /usr/lib/ symbol _Z18wxSafeConvertWX2MBPKw, version WXU_2.8 not defined in file with link time reference  

can you try setting jaunty-wx as preferred repo and doing the update & upgrade from synaptic instead of command line?

if it doesn’t recognize any new versions, uninstall codeblocks, apt-get autoremove and then reinstall from synaptic

oh dear, curses and double curses! I had codeblocks working fine with arturo’s file that is the wx-widgets from jaunty-wx. Then I clicked on the karmic upgrade without looking at which packages it wanted to upgrade and now I have the same problem as Oolong.

I ran the script again modified with --reinstall as an option in the apt-get install just for good measure.

I still have the problem.

I will dig around a bit but if anyone has a quick recipe I would be most grateful.

I see in synaptic that if I choose libwxbase2.8-0 and I choose Packages->Force Version, I can choose which version will be used. I have three in the list, the karmic default one, and the jaunty-wx 2.8.10-0 and also a jaunty-wx 2.6.10-1 one. I tried both the jaunty-wx ones and they didn’t work.

uninstall and reinstall of codeblocks is not working either

aaargh so confusing, now I forced the libwxbase2.8 and libwxgtk2.8 to use the karmic repository version and codeblocks works again.

this is the solution that worked for me, i added the source list that benben posted about here:

and when i checked my libwxbase2.8-0 package in synaptic , i had these packages available for me to force: (jaunty-wx) (karmic) (jaunty-wx) (hardy-wx) (hardy-wx) (hardy-wx)

and i force the (karmic) version (even if i was warned it would be a downgrade) and now codeblocks works again! :smiley:

otherwise it doesn’t seem i need to touch libwxgtk2.8

Same here - forcing “ (karmic)” in Synaptic solved the launch problem for me as well.
Thanks for posting!