Code::Blocks with C/C++ Compiler


ptitSeb

Serial Porter
Joined
Aug 15, 2012
Messages
9,306
Age
51
Location
France, near Lyon
Hi,

I have mixed the Code::Blocks pnd that is floating on the net and the C/C++ Development Environment v0.0.39 from freamon in a single PND.
It is just mixed, nothing more, so I take no credits for this.

I tested it, and I can save files (not all seems to be 100% correct, but I can save sources at least), and use the squashfs instead of ISO, so the file is "only" 52 Mb.


Should I put the PND on the repo ?

* EDIT * I now report the change logs in the first post.

The PND is now ont the repo : http://repo.openpand...=codeblocks6022

The PND with the version v1.02.03 and later is fully usable, but it's now much more in size !

History logs
=========
Update v2.40.15
  • Updated GCC to 6.3.0
  • Updated Codeblocks
  • Updated Qt to 5.8.0
  • Updated many libs!
Update v2.30.14
  • Updated GCC to 6.1.0
  • Updated Codeblocks
  • Codeblocks use a smaller font
  • Updated Qt to 5.7.0
  • Updated many libs!

Update v2.20.12
  • Updated GCC to 5.2.0
  • Updated Binutils to 2.25.1
  • Updated Codeblocks
  • Codeblocks use a smaller font
  • Updated Qt 5.5.0 & Qt 4.8.7
  • Updated many libs!
Update v2.10.12
  • Updated GCC to 4.9.3
  • Updated Binutils to 2.25
  • Updated Codeblocks
  • Added Qt 5.4.0
  • Added gnu D compiler (gdc)
  • Updated many libs!
Update v2.00.11
  • Updated GCC to 4.9.1
  • Updated Codeblocks
  • Updated many libs!
  • Automount wxPython, MonoRT and Lazarus
Update v1.06.10
  • Anniversary edition! Codeblocks PND is One year old
  • Updated GCC to 4.8.2
  • Added QTCreator
  • Added QT Demos
  • Updated /recompiled numerous library.
  • Default CFLAGS when launching command line.
  • Added many more libs & tools
  • Removed CLand & LLVM
Update v1.05.09
  • Update Code::Blocks to rev 8800
  • Added CLang and LLVM v3.3
  • Added Ruby
  • Added many more libs & tools
  • Added QT4.8.4 (+QtWebKit 4.9.3)
  • Use gksudo in most places

Update v1.05.08 (candidate to DragonBox coding competition 2012/13)
  • Update Code::Blocks to rev 8668 (rev. post 12.11 official)
  • Update GCC compiler to 4.7.2 (from 4.6.3)
  • Added other GCC compiler: Fortran, ObjC, Java
  • Added MesaGL (software rasteriser): Every GL Software compile now.
  • Added Winelib (1.5.20): windows software are compilable now. Transform them with "winemaker"
  • Update Python to 2.7.3 (from 2.6.2)
  • Update Perl to 5.17.6, with dynamic loading and cpan library access.
  • Added numerous libraries (OpenAL-soft 1.14, Allegro 5.1.5, Boost 1.51, fltk 1.3, SLML 2.0rc, etc.)
  • Hacked Binutils, so ld doesn't produce "assertion failled" messages
  • Added option for clean unmount of PND (add an empty file "clean_pnd" in appdata/codeblocks/init)
Update v1.04.07 contains:
  • Update Code::Blocks to 12.11rc2 (rev 8619)
  • Update GCC to 4.6.3 (from 4.3.3)
  • Update Binutils to 2.22 (from 2.18)
  • Update Git to 1.8 (from 1.7.0.2)
  • Add/Update numerous libs & tools (GNU TexInfo 4.13a, Bison 2.6, Zip 3.0, Unzip 6.0, Doygen 1.8.2, etc.)
You should note:
  • wxWidget path has changed from .../codeblocks/wx/2.8 to .../codeblocks/wx (sorry for the inconvenience, but should be pretty transparent).
  • ld (the linker) produce somes armless messages (assertion failled). All seems to works perfectly anyway.
  • Because Code::Blocks is a RC and the GNU has been update and the messages of ld, I tagged the PND as "beta". It seems fully functionnal anyway (builded DeaDBeaf build 05 and Cataclysm Roguelike with it).
Update v1.03.06 contains:
  • Fixed a regression that prevented ldconfig to be launched properly
  • Remove bosst library, I think there where not well installed
  • Added Lua 5.2 and Alsa-lib 1.0.25
Update v1.03.05 contains:
  • Remove Valgrind as it is not usable right now
  • Corrected some problem with compilation under Code::Blocks of previous release
Update v1.03.04 contains:
  • Added more library. The size of the PND is more than 200Mb now.
  • Added xz binary.
  • Added Valgrind binary. Valgrind works but is not useable (at least not the memcheck tool) because it is missing debug info on ld.so. It just wants the entrypoint for memcpy function.I Have no clue on how to get or generate the missing info, if a Ninja Linux guy could help, I'd like to use memcheck.
  • Added a Command Line Option, to compile with classics Linux tools, like ./configure and make
  • You should note that ;/configure often fail with C compiler unable to create executable.
  • It seems that, inside ./configure, the cc1plus compiler doesn't find its libraries (libmpfr.so.4 and libgmp.so.10), when it finds them outside ./configure
  • As a temporary workaround (copiing the .so in cc1plus folder doesn't work) , you can copy the 2 so files to your /usr.lib in NAND, and remove them when finished the ;/configure, make is fine
  • I created 2 shell scripts to automate that, pre-configure.sh and post-configure.sh, which must be launched with sudo to write to the nand
  • Also created a simple shell to copy the so files needed by a program that are not in the nand. It's called copy_libs.sh. For exemple, call it with /mnt/utmp/codeblocks/copy_libs.sh filezilla (assuming you have just compiled filezilla and are in it's bn folder) to have it copies 3 so files not located in the /lib or /usr/lib
Update v1.02.03 contains:
  • Just a small update, the package should be independant from C/C++ Environment. now.
Update v1.0.2.00 contains:
  • The C/C++/Python package v0.1.2.00 from Freamon (didn't test or uses Python).
  • Code::Block v10.05, that can save files !
  • wxWidget compiled (as monolithic and Unicode, but non-monolithic and ansi also available).
  • All Plugins and Contrib-Plugins (from 10.05), including the games, wxSmith or Valgrind.
  • Project Wizard works.
  • Compiling C or C++, and Debugging.
  • I modified some of the basics toolbars to gain some space, so it's now possible to put "Main", "Compile" and "Debug" on the same line. Save more space by going to "Settings|Environment|View" and select "Auto show/hide message pane".
Initial release constains:
  • The C/C++ package v0.0.39 from Freamon
  • Code::Block
 
Last edited:
Bah, I didn't want to waste internet space ^_^ .


But ok, it's done. I have just send it to the repo.


Hope it will work.
 
This isn't my PND, but I'm guessing the file permission error is because you've got the pnd on a fat32-formatted SD-card. It'll probably work if you put it on a ext2-formatted card instead.


It'll need re-pnd'ing if you want to stick with fat32 (and since it looks like it using an old version of the cdevtools stuff, it kinda needs re-doing anyways to be SuperZaxxon-compatible).
 
Yes, I think it need to be redone, I should have tested more.


I'll try to do it later, if it's ok with you (freamon). I don't want to steal your hard work.
 
Thanks Freamon, that's exactly what it is, I did wonder if it would matter.


I'm just starting with C/C++ and all this Pandora and pnd'ing malarkey so will probably try changing to an ext2-formatted card instead (unless some kind soul makes the necessary changes when upgrading the cdevtools stuff...)


@ p'titSeb I'd be delighted with any improvements you can make, I've not really used Code::Blocks before but have looked at it a few times and was really pleased to see it appear for the Pandora
 
Last edited by a moderator:
An updated version would be a super thing. I was trying to use it but ran into that same problem.
 
Yes, I think it need to be redone, I should have tested more.


I'll try to do it later, if it's ok with you (freamon). I don't want to steal your hard work.

"Steal" away! My pnd is entirely based on the work others have done with open source software, so it'd be massively churlish of me to complain about someone integrating my efforts into their own. I put other Pandora owners' work into my pnds all the time (smplayer into gpodder, notaz's SDL into don't take it personally) and barely give it a second thought.


If you don't know, the fix for fat32 cards when you update is: modify the PXML's appdata directory slightly, create a 'home' directory when the pnd is run for the first time, and set $HOME to that directory (for fat32, the issue is that you can write to the root of the appdata directory once, but not subsequently).


My startup scripts tend to look like:



Code:
pwd=$(pwd)


if [ ! -d home ]

then

	 mkdir home

fi


export HOME=$pwd/home
 
Ok, thanks for the tip Freamon. I also had another problem with my pnd, has I included an empty "config" folder that was suposed to be created by the startup script. I assume it was then treated as ReadOnly by the system (I'm not a master of the union thing)...


Anyway, I still have to work on the Code::Block part. Trying to compile the stable 10.05 release on the Pandora, but not tonight (may be it will be easier on the sebt3 toolchain ?).


All that takes forever on the pandora, especialy the PND Make part !


I hope to update the pnd on the repo in a day or two.
 
Yes !!! I have it now !


I recompiled Code::Block 10.05 for the Pandora (on the Pandora, can't cross-compile it on linux as the "autorevision" need to be compiled for the host, and it keeps be compiled for target).


After many hours, it finaly compiled (and so is wxWidget as it depends on that).


I search on the net the "cannot save" problem, and found this : http://forums.codebl...1.html#msg70971


So, it seems the problem is on wxWidget, not Code::Block (so, finaly,I didn't have to recompile CB afterall)...


I crudely patch wxWidget then, the common/filefn.cpp file, specifically the wxCreateTemp function


going from :



Code:
// get permissions of file1

if ( wxStat( file1.c_str(), &fbuf) != 0 )

{

// the file probably doesn't exist or we haven't the rights to read

// from it anyhow

wxLogSysError(_("Impossible to get permissions for file '%s'"),

file1.c_str());

return false;

}

to



Code:
// get permissions of file1

if ( wxStat( file1.c_str(), &fbuf) != 0 )

{

// the file probably doesn't exist or we haven't the rights to read

// from it anyhow

//wxLogSysError(_("Impossible to get permissions for file '%s'"),

// file1.c_str());

//return false;

mode_t mask = umask(0777);

fbuf.st_mode = 0666 & ~mask;

umask(mask);

}



and also



from



Code:
// no chmod in VA. Should be some permission API for HPFS386 partitions

// however

if ( chmod(OS_FILENAME(file2), fbuf.st_mode) != 0 )

{

	 wxLogSysError(_("Impossible to set permissions for the file '%s'"),

					 file2.c_str());

	 return false;

}



to





Code:
// no chmod in VA. Should be some permission API for HPFS386 partitions

// however

if ( chmod(OS_FILENAME(file2), fbuf.st_mode) != 0 )

{

	 wxLogSysError(_("Impossible to set permissions for the file '%s'"),

					 file2.c_str());

//return false;

}


Not pretty, but it works.


I will play with the toolbar, to reduce the size (remove labels and separators, to save space), compile all plugins, and then I have to repackage all that, so more headache coming...


So I hope to have a brand new pnd a day max.
 
Last edited by a moderator:
So I hope to have a brand new pnd a day max.
yeeehhaaa
Nice! Yeah it is possible to make the default C::B usable on 800x480 by only using one line for the toolbar and only having General/Build/Debug tools visable. Also if you can permenantly get rid of the status bar, that gives you a few more pixels of space.
 
You da man.


At least when saving works within CB, the layout should also be saved, so once a reasonable UI layout has been set, it shouldn't need to be done again.
 
Hum, I am having difficulties with the creation of the pnd.


I have put everything on ext2 partition, and all is working fine. It's quite big, around 450Mo...


When I do the pnds, using squashfs, it goes down to 136Mo... But it just doesn't work. I cannot mount the pnd.


It look ok, a "file" on it give something like



Code:
codeblocks.pnd: Squashfs filesystem, little endian, version 4.0, 36498302207 bytes, 18591 inodes, blocksize: 8 bytes, created: Sun Jan 1 09:00:33 1905

and if I mount it on a Linux VM (using "sudo mount -t squashfs -oloop codeblocks.pnd /mnt/utmp/codeblocks") it works well.

Also, the same command from the pandora also works (a fully functionnal Code::Block with all the plugins, you have to choose which toolbar you want with the small pandora's screen <_< )?!!!



Why my pnds doesn't automount :angry: ???



for building, I use this command



Code:
pnd_make -d codeblocks -p codeblocks.pnd -c -i codeblocks/icon.png



When I try to mount via /usr/pandora/script/pnd_run.sh, it fail at mount, with that message in the pndrun_codeblocks.out :



Code:
=======================================================================================

PND			 : /media/PANDOSEB/pandora/menu/codeblocks.pnd

PND_FSTYPE	 : Squashfs

APPDATADIR	 : /media/PANDOSEB/pandora/appdata/codeblocks

APPDD_FSTYPE : vfat

PND_CPUSPEED : <unset>

EXENAME		 : 0

ARGUMENTS	 : <unset>

=======================================================================================

[ START ]--- Mount the PND ----------

Found a loop (/dev/loop0), using it

losetup: /dev/loop0: device is busy

Mounting : mount -t squashfs -o ro "/dev/loop0" "/mnt/utmp/codeblocks"

mount: wrong fs type, bad option, bad superblock on /dev/loop0,

	 missing codepage or helper program, or other error

	 In some cases useful info is found in syslog - try

	 dmesg | tail or so

WARNING : mount faild, re-tring

mount: wrong fs type, bad option, bad superblock on /dev/loop0,

	 missing codepage or helper program, or other error

	 In some cases useful info is found in syslog - try

	 dmesg | tail or so

ERROR The PND File-system is not mounted !

+++++++

Loopback devices :

/dev/loop0: [b301]:1602 (/media/PANDOSEB/pandora/menu/codeblocks.pnd)

Are mounted on :

For these Union :

[ FAILED]--- Mount the PND ----------

=======================================================================================

Return code is : 7


And there is nothing in dmseg | tail relevant to the error ?


I'll continue to dig (I will analyse how the run_pnd.sh works :wacko: ), but if someone have an idea (sorry, can't post the pnd, too big for this forum, but as a teaser, here a snapshot intended for the pnd)...

preview6.png
 
Ok, nevermind, it works now.


I suppose it was because I tried a corrupted package before and didn't reboot after I realised the package was corrupted (due to lack of space on my tiny ext2 partition).


So, I'll upload the package to the repo...


For those interested, it contains :


* The C/C++/Python package v0.1.2.00 from Freamon (didn't test or uses Python)


* Code::Block v10.05, that can save files !


* wxWidget compiled (as monolithic and Unicode, but non-monolithic and ansi also available)


* All Plugins and Contrib-Plugins (from 10.05), including the games (ok, it's really small but tetris works well), wxSmith or Valgrind (didn't test).


* Project Wizard works (I tried the wxWidget one successfully)


* Compiling C or C++, and even Debugging works


* I modify some of the basics toolbars to gain some space, so it's now possible to put "Main", "Compile" and "Debug" on the same line.


I didn't have a lot of time to play with it, but I hope it will be usefull for other than myself :) .
 
Last edited by a moderator:
The line "* wxWidget compiled (as monolithic and Unicode, but non-monolithic and ansi also available)" brought back dark memories of compiling MediaInfo on the Pandora, in that I built wxWidgets (which took ages), and then built MediaInfo (which took even longer), and only at the very end did it say that wxWidgets needed to be ansi, not unicode, (or maybe the other way around).


Anyways, back on topic: Good to see you've got it working (it's re-assuring to know there's someone else who's watched pnd-make go "1% .............. 2% ....................".
 
Back
Top