Code::Blocks

User forums => Using Code::Blocks => Topic started by: tigerbeard on September 22, 2018, 12:53:03 am

Title: Advice on Version for Ubuntu
Post by: tigerbeard on September 22, 2018, 12:53:03 am
After getting started with the CB 16.01 in Ubuntu 16.04LTS I am getting constant crashed in all sort of situations. Its a bit of a surprise, since on Windows I can not recall a single crash of C::B in many years.

I hope there are a lot of people out there using CodeBlocks in Linux (including Ubuntu), so you maybe someone could give me their experience on what version their regards as the most stable to use.

thanks
Title: Re: Advice on Version for Ubuntu
Post by: oBFusCATed on September 22, 2018, 09:09:15 am
The latest and greatest. 16.01 is full of crashes especially on ubuntu, which have been identified and fixed for 17.12.
I've posted patches for many crashes with 16.01 on launchpad, you can check with ubuntu's developers if they've been applied or not.
But generally it is better to just update (if you cannot find packages, just build them yourself).

One major source of crashes is the symbol browser. If you disable it the frequency would lower, but there are others.
Title: Re: Advice on Version for Ubuntu
Post by: tigerbeard on September 22, 2018, 02:59:15 pm
Great, thanks that is very helpful info not continue to wast time on 16.01 versions.

Before reading you reply I just installed 17.02. I am sorry to say that, but I find it unusable, because you seem to have totally disabled the symbol browser.  I thought from the release notes its just deactivated by default. I must add that the SB actually is the killer feature of C::B for me and I am totally lost without it (even more with this huge tree leaf spacing).

Interesting to learn that its troubles (using thread gui code etc.) are causing so much worse trouble than in windows, where it often hangs but it never crahed on me. Is there any (dirty) way to get the symbol browser enabled because I'd love to check out the 17.12 official?

If not, do I have the chance to get it enabled in the nightlies?
Title: Re: Advice on Version for Ubuntu
Post by: BlueHazzard on September 22, 2018, 05:51:54 pm
Quote
s there any (dirty) way to get the symbol browser enabled because I'd love to check out the 17.12 official?
If you activate the symbol browser you will get the crashes. The only solution is to rewrite the whole part of codeblocks, but there is no dev who is willing to do it (help is needed)

One possible solution is to compile codeblocks by yourself but with wxWidgets 2.8.X instead of the official wxWidgets 3.X.X of your ubuntu distribution. This should be possible and it should work without crashing....
Title: Re: Advice on Version for Ubuntu
Post by: tigerbeard on September 22, 2018, 06:16:54 pm
Quote
If you activate the symbol browser you will get the crashes.
I am aware of that.
But that does not mean its not useful. Example. try to look at foreign code with 20.000Loc with SB or with File view only. The file view does not tell you anything about how large the classes are, public/private functions, member vars name space structure, name it. And when i have 1hr to check out such a  project, I'd still do it with a CB crahing on me 10times in that time, rather than doing it without a symbol browser.
 
Quote
The only solution is to rewrite the whole part of codeblocks, but there is no dev who is willing to do it (help is needed)
I can fully understand its hard to to such a rewrite in open source. The use case above would benefit from a "lock" button to quickly enable/disable it until its being eventually fixed. Just an example of an other "solution".

Quote
One possible solution is to compile codeblocks by yourself but with wxWidgets 2.8.X instead of the official wxWidgets 3.X.X of your ubuntu distribution. This should be possible and it should work without crashing..
Cool. Although I guess this implies the nightlies also do lock the SB feature.

If compiling CB 17.12 with 2.8 is an option that a good way out indeed. I had thought that I did read somewhere that wx3.xx is a requirement for 17.12 and it would not compile, but maybe I misunderstood that.

So if when I did compile it with 2.8, how would I enable the SB then? Woudn't it still be locked?

Title: Re: Advice on Version for Ubuntu
Post by: oBFusCATed on September 22, 2018, 06:49:42 pm
Symbol browser is disabled for all wx3.x builds. It is enabled for wx2.8, builds I think. If you build the code you can find the place where we disable it and you should remove this part of the code.
Title: Re: Advice on Version for Ubuntu
Post by: tigerbeard on September 22, 2018, 07:45:21 pm
How can I find out the latest 2.8 build? I guess is not somehting with 17 in the version number?
Title: Re: Advice on Version for Ubuntu
Post by: BlueHazzard on September 22, 2018, 07:57:04 pm
You can build the current trunk code with wx2.8. It will build fine, we support both versions at the moment...
Title: Re: Advice on Version for Ubuntu
Post by: tigerbeard on September 22, 2018, 08:19:06 pm
Great. Thanks.

one final question, since i never build CB before. When building the SVN/GIT sources, will I end up with all plugins?

I am asking because when installing from the PPAs I first installed
 
Code: [Select]
sudo apt install codeblocks Then I was surprised to see the IDE pretty lean. It was missing all plugins including Thread Search and wxSmith. After using
 
Code: [Select]
sudo apt install codeblocks codeblocks-contrib codeblocks-wxcontrib-devI got the full IDE. Then saw the repo had a lot more packages like codeblocks-common, wxsmith, some xxx-headers and other xxx-devs. They seem to be sensivite to the version - I got in apt mixup trouble between two 16.01 builds.
Title: Re: Advice on Version for Ubuntu
Post by: BlueHazzard on September 22, 2018, 10:47:55 pm
you can try this instruction:
https://github.com/bluehazzard/codeblocks_sf/wiki/build_linux_mint_18

WARNING: this will build codeblocks with wx30
i do not know how to switch to wx2.8 if you have installed wx30 and wx28 with ./configure

to answer your question, you have to add
Code: [Select]
--with-contrib-plugins=all to your configure line

please report if it worked...

[Edit:] i updated with a section to build with wx2.8

Title: Re: Advice on Version for Ubuntu
Post by: tigerbeard on September 24, 2018, 06:37:21 pm
Thanks for the update of that section.

I got errors on ./bootstrap
Code: [Select]
configure.ac warning: macro 'AM_OPTIONS_WXCONFIG' not found in library
 configure.ac warning: macro 'AM_PATH_WXCONFIG' not found in library
 ..
 configure.ac error: possible undefinded macro: AM_PATH_WXCONFIG
Does that ring any bells?

EDIT: I am using the trunc tarball from sourceforge
Title: Re: Advice on Version for Ubuntu
Post by: stahta01 on September 24, 2018, 06:43:21 pm
http://wiki.codeblocks.org/index.php/Installing_Code::Blocks_from_source_on_Linux (http://wiki.codeblocks.org/index.php/Installing_Code::Blocks_from_source_on_Linux)

Edit2: The above links gives two fixes; I normally do this one on Debian.
Code: [Select]
export ACLOCAL_FLAGS="-I `wx-config --prefix`/share/aclocal"
Title: Re: Advice on Version for Ubuntu
Post by: BlueHazzard on September 24, 2018, 07:14:09 pm
I have tested this on a fresh xubuntu installation. I did not had this error, but i installed wxWidgets first from the official ubuntu repo. Maybe that made a difference... If you find a working fix, please let me know

http://wiki.codeblocks.org/index.php/Installing_Code::Blocks_from_source_on_Linux (http://wiki.codeblocks.org/index.php/Installing_Code::Blocks_from_source_on_Linux)

Edit2: The above links gives two fixes; I normally do this one on Debian.
Code: [Select]
export ACLOCAL_FLAGS="-I `wx-config --prefix`/share/aclocal"
I am not sure if this works, because wx-config can probably not be found if you use the --with-wx-config configure option later and don't use a "installed" wxWidgets installation. You probably have to use the full path to your temporary wxWidgets installation...
so something like this
Code: [Select]
export ACLOCAL_FLAGS="-I /home/USERNAME/wxWidgets/install/share/aclocal" if you have used
Code: [Select]
--prefix=/home/USERNAME/wxWidgets/install at the configuration process of wxWidgets
Title: Re: Advice on Version for Ubuntu
Post by: tigerbeard on September 24, 2018, 07:42:32 pm
http://wiki.codeblocks.org/index.php/Installing_Code::Blocks_from_source_on_Linux (http://wiki.codeblocks.org/index.php/Installing_Code::Blocks_from_source_on_Linux)

Edit2: The above links gives two fixes; I normally do this one on Debian.
Code: [Select]
export ACLOCAL_FLAGS="-I `wx-config --prefix`/share/aclocal"
Thanks for the link to your description. I had been following that from BlueHazzards post. I did run it on 2 different PCs, one compiled the other did not. The difference had been what had been installed previously or not. On both I did not use a prefix, which I guess was not perfect.
After recompiling wxGTK according to statha01's line I got this out of the way location in a repeatable way, which I think is a good idea. Still this macro errors appeard, but on the instructions the fix was given as
 On Ubuntu install wx-common

In fact that solved it. Also that explains why the other PC had worked. It indeed had the package installed before.
Title: Re: Advice on Version for Ubuntu
Post by: tigerbeard on September 24, 2018, 08:50:11 pm
OK. Now it worked.
For those interested on the Xubuntu 16.04LTS install, here is some feedback


Special thanks for BlueHazzard and stahta01 (and of course oBFusCATed [as always]  :)) for the very good help