Updated Ubuntu packages (i386 + AMD64 for Precise through Trusty) will soon be available here (https://code.launchpad.net/~damien-moore/+archive/codeblocks-nightly).
sudo add-apt-repository ppa:damien-moore/codeblocks-nightly
sudo apt-get update
sudo apt-get install codeblocks codeblocks-contrib
Note: If you are using Code::Blocks from Pasgui's repository you will need to uninstall it and disable that repo before adding this one and reinstalling.
Workaround for possible crash related to compiler plugin at start up:
1. Open terminal, run "codeblocks --safe-mode"
2. Plugins -> Manage Plugins -> Compiler plugin -> Enable, then close the dialog
3. Accept all prompts
4. Close codeblocks
5. Start codeblocks as you normally would and everything should work normally.
Check here: http://forums.codeblocks.org/index.php/topic,18528.msg126762.html#msg126762
Jens' packages are not compatible with ubuntu, probably you can read this on his page.
Thanks! I don't know why moore doesn't have his repos added to the codeblocks website...would be a hell of a lot easier for everyone.
Anyways jens' debian builds are working just fine for me, i'd switch to moore's but i noticed he doesn't give the actual build version name to his builds like jens (or i am missing the point...) because while jens' is named "svn9453" and i KNOW it is a recent version, moore's is named "trunkbzr7726.lp" which i don't really know what it stands for....
I use Kubuntu and build C::B myself using Jens' preconfigured tarball source here
http://apt.jenslody.de/testing/pool/main/c/codeblocks/ (download filename *.orig.tar.gz)
HOWTO
1. download *.orig.tar.gz as explained above
2. Expand in folder with full ownership (I tend to get problems with e.g. Windows NTFS partitions, so use ext3/ext4 instead)
3. If you have special build of wxWidgets 2.8.12 like me, build against the official Kubuntu repository version. You may have to edit the debian/rules file in the expanded files, and add the option shown in red
DEB_CONFIGURE_EXTRA_FLAGS=--with-contrib-plugins=all --with-wx-config=/usr/bin/wx-config --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info
4. Then just do
the result is a collection of .deb files. The svn number changes every time, but for 9099 the installation was done like this
$ sudo dpkg -i codeblocks-common_12.11svn9099_all.deb
$ sudo dpkg -i libcodeblocks0_12.11svn9099_i386.deb
$ sudo dpkg -i libwxsmithlib0_12.11svn9099_i386.deb
$ sudo dpkg -i codeblocks_12.11svn9099_i386.deb
$ sudo dpkg -i codeblocks-contrib-common_12.11svn9099_all.deb
$ sudo dpkg -i codeblocks-libwxcontrib0_12.11svn9099_i386.deb
$ sudo dpkg -i codeblocks-contrib_12.11svn9099_i386.deb
When upgrading, I typically get some warnings the first time this script is executed. By running the script one more time, all is fine.
Try something totally generic, like:
#include <stdio.h>
#include <stdlib.h>
#define nil(T) ((T)(void *)0)
typedef struct demo_t {
const char *name;
} demo_t;
int main(void)
{
demo_t * d = (demo_t *) malloc(sizeof(demo_t));
if (d == nil(demo_t *)) goto error;
d->name = "demo";
printf("Name: %s\n", d->name);
free(d);
d = nil(demo_t *);
error: /* <-- Here, as I start typing, the auto-completion starts
and even when i reach the last character ':' from
goto label, it still insists to display it, as available keyword.
If I press tab key or enter, instead of keeping
the already typed label name, it re-enters it
right after the already typed label name.
*/
if (d) {
free(d);
d = nil(demo_t *);
}
return 0;
}
@devs: I think it would be best to just revert lines 748-749 of src/plugins/scriptedwizard/resources/wxwidgets/wizard.script for now (instead of trying to fix multi-script compiler options), do you agree?
if (WxVersion < 2 && GetCompilerFactory().CompilerInheritsFrom(Wizard.GetCompilerID(), _T("gcc*")))
project.AddCompilerOption(_T("[[if (GetCompilerFactory().GetCompilerVersionString(_T(\"gcc\")) >= _T(\"4.8.0\")) print(_T(\"-Wno-unused-local-typedefs\"));]]"));
On a second thought, maybe it would be better to keep those lines, and instead remove
project.AddCompilerOption(_T("[[if (PLATFORM == PLATFORM_MSW && (GetCompilerFactory().GetCompilerVersionString(_T(\"gcc\")) >= _T(\"4.0.0\"))) print(_T(\"-Wno-attributes\"));]]"));
from the wizard. I have been unable to discover what warnings -Wno-attributes is supposed to silence that come up in wxWidgets projects; however, if try to use GCC 4.8 on wx2.8.12 without -Wno-unused-local-typedefs the log is drowned with these warnings.
I see this error: (see screen shot below)
It happens when I open a simple wx2.8.12 project(from wx wizard), or press the build button.
Have any CB project in the past used two scripts in the Compiler other options before?
I think two does NOT work; I deleted either one and the error went away on the next project re-build.
Tim S.
Thank Tim, indeed, I see that the compiler options has such code:
-pipe
-mthreads
[[if (PLATFORM == PLATFORM_MSW && (GetCompilerFactory().GetCompilerVersionString(_T("gcc")) >= _T("4.0.0"))) print(_T("-Wno-attributes"));]]
[[if (GetCompilerFactory().GetCompilerVersionString(_T("gcc")) >= _T("4.8.0")) print(_T("-Wno-unused-local-typedefs"));]]
-Winvalid-pch
-include wx_pch.h
@Alpha:
I don't know the reason we need "-Wno-attributes" options.
I do know that "-Wno-unused-local-typedefs" was used to remove build warnings.
-Wno-attributes came from rev 4596:
http://cb.biplab.in/websvn/log.php?repname=codeblocks&path=%2F&isdir=1&peg=9462&sr=4596&er=1&max=1&search=
I have removed -Wno-attributes from the wizard in trunk now, as -Wno-unused-local-typedefs looks to be currently a much more useful command.
Currently compiled svn9468 on Windows 7 machine (at work) and auto-completion does not work properly.
As soon as I insert (*prd->st_info)->, instead of seeing the desired variables, I see whatever prd
has in it.
See the entire sample below:
/*
* Placed in Public Domain where applicable permitted by law.
* USE IT AT YOUR OWN RISK!
*/
#include <stdio.h>
#include <stdlib.h>
#define nil ((void *)0)
typedef struct {
int postal_code;
const char *address;
} street_info_t;
typedef struct {
street_info_t **st_info;
const char *company_name;
} generic_t;
street_info_t * str_constructor(void) {
street_info_t *tmp = (street_info_t *) malloc(sizeof(street_info_t));
if (tmp == nil) {
return nil;
}
return tmp;
}
void str_destructor(street_info_t **self) {
if (*self != nil) {
free(*self);
*self = nil;
}
return;
}
generic_t * constructor(void) {
generic_t *tmp = (generic_t *) malloc(sizeof(generic_t));
if (tmp == nil) {
return nil;
}
return tmp;
}
void destructor(generic_t **self) {
if (*self != nil) {
free(*self);
*self = nil;
}
return;
}
int main(void)
{
generic_t *prd = constructor();
street_info_t *street = str_constructor();
prd->st_info = &street;
prd->company_name = "Disney Land";
(*prd->st_info)->address = "Mikey Mouse avenue, Neverland";
(*prd->st_info)->postal_code = 1010;
printf("Company Name: %s\n", prd->company_name);
printf("Address: %s\n", (*prd->st_info)->address);
printf("Postal code: %d\n", (*prd->st_info)->postal_code);
str_destructor(&street);
prd->st_info = nil;
destructor(&prd);
return 0;
}
Windows NON PCH (Precompiled Header) build issue.
I am testing some rarely built projects for wxWidgets 3.0 issues and got error building ModPoller Optional Plugin.
Tim S.
Index: src/plugins/modpoller/ModPoller.h
===================================================================
--- src/plugins/modpoller/ModPoller.h (revision 9479)
+++ src/plugins/modpoller/ModPoller.h (working copy)
@@ -13,6 +13,7 @@
#endif
#include <cbplugin.h>
+#include <editormanager.h>
class ModPoller : public cbPlugin
{
*** Error in `codeblocks': corrupted double-linked list: 0x0bf06690 ***
======= Backtrace: =========
/lib/i386-linux-gnu/i686/cmov/libc.so.6(+0x75e52)[0xb5b40e52]
/lib/i386-linux-gnu/i686/cmov/libc.so.6(+0x782ce)[0xb5b432ce]
/lib/i386-linux-gnu/i686/cmov/libc.so.6(__libc_malloc+0x53)[0xb5b443e3]
/usr/lib/i386-linux-gnu/libwx_baseu-2.8.so.0(_ZN12wxStringBase11AllocBufferEj+0x44)[0xb6927654]
/usr/lib/i386-linux-gnu/libwx_baseu-2.8.so.0(_ZN12wxStringBase16AllocBeforeWriteEj+0x38)[0xb6927838]
/usr/lib/i386-linux-gnu/libwx_baseu-2.8.so.0(_ZN8wxString11GetWriteBufEj+0x24)[0xb6929854]
/usr/lib/i386-linux-gnu/libwx_baseu-2.8.so.0(_ZN8wxString9FromAsciiEPKc+0xa4)[0xb692a084]
/usr/lib/i386-linux-gnu/libwx_baseu-2.8.so.0(_ZN16wxDynamicLibrary10ListLoadedEv+0x15e)[0xb694d50e]
/usr/lib/i386-linux-gnu/libwx_gtk2u_qa-2.8.so.0(_ZN13wxDebugReport18DoAddLoadedModulesEP9wxXmlNode+0x22)[0xb6eaaf32]
/usr/lib/i386-linux-gnu/libwx_gtk2u_qa-2.8.so.0(_ZN13wxDebugReport10AddContextENS_7ContextE+0x45b)[0xb6ead2db]
/usr/lib/i386-linux-gnu/libwx_gtk2u_qa-2.8.so.0(_ZN13wxDebugReport6AddAllENS_7ContextE+0x17)[0xb6eaeb37]
codeblocks[0x808b066]
/usr/lib/i386-linux-gnu/libwx_baseu-2.8.so.0(wxFatalSignalHandler+0x23)[0xb6966cf3]
linux-gate.so.1(__kernel_sigreturn+0x0)[0xb77d8400]
[0x94a1a06]
======= Memory map: ========
08048000-081b2000 r-xp 00000000 fe:00 753836 /usr/local/bin/codeblocks
081b2000-081ba000 r--p 0016a000 fe:00 753836 /usr/local/bin/codeblocks
081ba000-081bd000 rw-p 00172000 fe:00 753836 /usr/local/bin/codeblocks
081bd000-081c2000 rw-p 00000000 00:00 0
0910c000-0c136000 rw-p 00000000 00:00 0 [heap]
a78e0000-a78e1000 ---p 00000000 00:00 0
a78e1000-a80e1000 rwxp 00000000 00:00 0
a80e1000-a81ff000 rw-p 00000000 00:00 0
a81ff000-a8200000 ---p 00000000 00:00 0
a8200000-a8a00000 rwxp 00000000 00:00 0
a8a00000-a8a21000 rw-p 00000000 00:00 0
a8a21000-a8b00000 ---p 00000000 00:00 0
a8b0e000-a8b0f000 ---p 00000000 00:00 0
a8b0f000-a930f000 rwxp 00000000 00:00 0
a930f000-a935c000 r--p 00000000 fe:00 13541624 /usr/share/fonts/truetype/dejavu/DejaVuSansMono-Bold.ttf
a935c000-a9378000 r-xp 00000000 fe:00 1278640 /usr/local/lib/codeblocks/plugins/libIncrementalSearch.so
a9378000-a9379000 r--p 0001c000 fe:00 1278640 /usr/local/lib/codeblocks/plugins/libIncrementalSearch.so
a9379000-a937a000 rw-p 0001d000 fe:00 1278640 /usr/local/lib/codeblocks/plugins/libIncrementalSearch.so
a937a000-a9385000 r-xp 00000000 fe:00 15351896 /usr/local/lib/codeblocks/plugins/libSmartIndentCpp.so
a9385000-a9386000 r--p 0000a000 fe:00 15351896 /usr/local/lib/codeblocks/plugins/libSmartIndentCpp.so
a9386000-a9387000 rw-p 0000b000 fe:00 15351896 /usr/local/lib/codeblocks/plugins/libSmartIndentCpp.so
a9387000-a9442000 r-xp 00000000 fe:00 1278635 /usr/local/lib/codeblocks/plugins/libHexEditor.so
a9442000-a9445000 r--p 000ba000 fe:00 1278635 /usr/local/lib/codeblocks/plugins/libHexEditor.so
a9445000-a9447000 rw-p 000bd000 fe:00 1278635 /usr/local/lib/codeblocks/plugins/libHexEditor.so
a9447000-a9448000 rw-p 00000000 00:00 0
a9448000-a94ac000 r-xp 00000000 fe:00 1278608 /usr/local/lib/codeblocks/plugins/libDoxyBlocks.so
a94ac000-a94ad000 ---p 00064000 fe:00 1278608 /usr/local/lib/codeblocks/plugins/libDoxyBlocks.so
a94ad000-a94af000 r--p 00064000 fe:00 1278608 /usr/local/lib/codeblocks/plugins/libDoxyBlocks.so
a94af000-a94b0000 rw-p 00066000 fe:00 1278608 /usr/local/lib/codeblocks/plugins/libDoxyBlocks.so
a94b0000-a94c8000 r-xp 00000000 fe:00 1278543 /usr/local/lib/codeblocks/plugins/libdefaultmimehandler.so
a94c8000-a94c9000 r--p 00018000 fe:00 1278543 /usr/local/lib/codeblocks/plugins/libdefaultmimehandler.so
a94c9000-a94ca000 rw-p 00019000 fe:00 1278543 /usr/local/lib/codeblocks/plugins/libdefaultmimehandler.so
a94ca000-a954e000 r-xp 00000000 fe:00 1278628 /usr/local/lib/codeblocks/plugins/libheaderfixup.so
a954e000-a9550000 r--p 00084000 fe:00 1278628 /usr/local/lib/codeblocks/plugins/libheaderfixup.so
a9550000-a9551000 rw-p 00086000 fe:00 1278628 /usr/local/lib/codeblocks/plugins/libheaderfixup.so
a9551000-a9568000 r-xp 00000000 fe:00 1278598 /usr/local/lib/codeblocks/plugins/libCppCheck.so
a9568000-a9569000 ---p 00017000 fe:00 1278598 /usr/local/lib/codeblocks/plugins/libCppCheck.so
a9569000-a956a000 r--p 00017000 fe:00 1278598 /usr/local/lib/codeblocks/plugins/libCppCheck.so
a956a000-a956b000 rw-p 00018000 fe:00 1278598 /usr/local/lib/codeblocks/plugins/libCppCheck.so
a956b000-a95a1000 r-xp 00000000 fe:00 1278561 /usr/local/lib/codeblocks/plugins/libtodo.so
a95a1000-a95a2000 ---p 00036000 fe:00 1278561 /usr/local/lib/codeblocks/plugins/libtodo.so
a95a2000-a95a4000 r--p 00036000 fe:00 1278561 /usr/local/lib/codeblocks/plugins/libtodo.so
a95a4000-a95a5000 rw-p 00038000 fe:00 1278561 /usr/local/lib/codeblocks/plugins/libtodo.so
a95a5000-a95e3000 r-xp 00000000 fe:00 1278644 /usr/local/lib/codeblocks/plugins/libkeybinder.so
a95e3000-a95e4000 ---p 0003e000 fe:00 1278644 /usr/local/lib/codeblocks/plugins/libkeybinder.so
a95e4000-a95e6000 r--p 0003e000 fe:00 1278644 /usr/local/lib/codeblocks/plugins/libkeybinder.so
a95e6000-a95e7000 rw-p 00040000 fe:00 1278644 /usr/local/lib/codeblocks/plugins/libkeybinder.so
a95e7000-a9674000 r-xp 00000000 fe:00 1278648 /usr/local/lib/codeblocks/plugins/liblib_finder.so
a9674000-a9675000 ---p 0008d000 fe:00 1278648 /usr/local/lib/codeblocks/plugins/liblib_finder.so
a9675000-a9678000 r--p 0008d000 fe:00 1278648 /usr/local/lib/codeblocks/plugins/liblib_finder.so
a9678000-a967a000 rw-p 00090000 fe:00 1278648 /usr/local/lib/codeblocks/plugins/liblib_finder.so
a967a000-a96ca000 r-xp 00000000 fe:00 1278567 /usr/local/lib/codeblocks/plugins/libAutoVersioning.so
a96ca000-a96cc000 r--p 0004f000 fe:00 1278567 /usr/local/lib/codeblocks/plugins/libAutoVersioning.so
a96cc000-a96cd000 rw-p 00051000 fe:00 1278567 /usr/local/lib/codeblocks/plugins/libAutoVersioning.so
a96cd000-a96d5000 r-xp 00000000 fe:00 15303333 /usr/local/lib/codeblocks/plugins/libSmartIndentHDL.so
a96d5000-a96d6000 r--p 00007000 fe:00 15303333 /usr/local/lib/codeblocks/plugins/libSmartIndentHDL.so
a96d6000-a96d7000 rw-p 00008000 fe:00 15303333 /usr/local/lib/codeblocks/plugins/libSmartIndentHDL.so
a96d7000-a96f2000 r-xp 00000000 fe:00 15303328 /usr/local/lib/codeblocks/plugins/libSymTab.so
a96f2000-a96f3000 r--p 0001b000 fe:00 15303328 /usr/local/lib/codeblocks/plugins/libSymTab.so
a96f3000-a96f4000 rw-p 0001c000 fe:00 15303328 /usr/local/lib/codeblocks/plugins/libSymTab.so
a96f4000-a96fc000 r-xp 00000000 fe:00 1278583 /usr/local/lib/codeblocks/plugins/libCccc.so
a96fc000-a96fd000 r--p 00008000 fe:00 1278583 /usr/local/lib/codeblocks/plugins/libCccc.soAborted
The following crashing happens when I start C::B and switch to another window while still loading its plugins. I guess it has something to do with "Focus on Window" event (if that's the event name)?
Version: svn9470
OS: GNU / Linux Debian testing (jessie), 32-bit
GCC: 4.8.2 (32-bit)
Desktop Environment: MATE 1.6.0
The steps are:
- Ctrl-F2 to open "run" window. Type "codeblocks" in it.
- Run it and as soon as you see the splash window, alt-tab to switch to another window so "Focus Window" event switch to that.
- While it loads and you are on the window I have mentioned before, just before the finishing of GUI drawing, alt-tab to switch window again and voila; you got it crashed.
i have the same issue. Latest svn version.
If i start c::b and alt tab to a other window, c::b will load till the end, but as soon i switch back, i get a crash report:
<frame level="0"/><frame level="1" function="wxAppBase::SendIdleEvents(wxWindow*, wxIdleEvent&)" offset="0000007e"/><frame level="2" function="wxAppBase::ProcessIdle()" offset="00000074"/><frame level="3"/><frame level="4" function="g_main_context_dispatch" offset="00000135"/><frame level="5"/><frame level="6" function="g_main_loop_run" offset="0000006a"/><frame level="7" function="gtk_main" offset="000000a7"/><frame level="8" function="wxEventLoop::Run()" offset="00000048"/><frame level="9" function="wxAppBase::MainLoop()" offset="0000004c"/>
from gdb:
#0 0x00007ffff548ab18 in main_arena () from /lib/x86_64-linux-gnu/libc.so.6
#1 0x00007ffff6f782b4 in wxAppBase::SendIdleEvents(wxWindow*, wxIdleEvent&) ()
from /usr/local/lib/libwx_gtk2u-2.8.so.0
#2 0x00007ffff6f78764 in wxAppBase::ProcessIdle() ()
from /usr/local/lib/libwx_gtk2u-2.8.so.0
#3 0x00007ffff6efc92e in wxapp_idle_callback ()
from /usr/local/lib/libwx_gtk2u-2.8.so.0
#4 0x00007ffff30d8f05 in g_main_context_dispatch ()
from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5 0x00007ffff30d9248 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#6 0x00007ffff30d96ba in g_main_loop_run ()
from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#7 0x00007ffff78d4fe7 in gtk_main ()
from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#8 0x00007ffff6f10278 in wxEventLoop::Run() ()
from /usr/local/lib/libwx_gtk2u-2.8.so.0
#9 0x00007ffff6f7850c in wxAppBase::MainLoop() ()
from /usr/local/lib/libwx_gtk2u-2.8.so.0
#10 0x000000000046459e in CodeBlocksApp::OnRun (this=0x84aee0)
at /codeblocks_sf/src/src/app.cpp:809
#11 0x00007ffff6e90045 in wxEntry(int&, wchar_t**) ()
from /usr/local/lib/libwx_gtk2u-2.8.so.0
#12 0x0000000000461b19 in main (argc=1, argv=0x7fffffffe448)
at /codeblocks_sf/src/src/app.cpp:276
greetings