Code::Blocks with C/C++ Compiler


Ok, found it !


I removed a call to ldconfig in the init part, because I didn't like to type my admin password when I created the launch file for the pnd... Bad idea, as the last one that make the call wins (sort of), and the one was... cdevtools of course.


And no-one relaunch a "clean" ldconfig (me neither)...


So, I added back a sudo ldconfig blah blah.. It works better, but now, some libs are missing :unsure: (*EDIT* no, all is here, more mistakes on my side, it's almost 2h00, time to go to bed, really). More work I guess... May be an update in a day or two now that I figured out what was wrong :) (*EDIT* Uploading now... It take ages to upload)
 
Last edited by a moderator:
Ah yes, curse that having to stop doing stuff and fall unconscious for a few hours thing. Always gets in the way of doing stuff.


This'll be great, having the same dev environment on the desktop, laptop and Pandora. I'll have even fewer excuses for not getting any programming done.
 
It's done. At last it's on the repo.


I'm not sure of the method I used for the ldconfing...


I just use, in the runscript.sh, something like



Code:
terminal --title "blah blah" --execute sudo ldconfig -f blahblah


I just hope it's enough...


Time to sleep for me now, bye...
 
Alright, Seb!


Looks like it's compiling stuff without cdevtools. Great. Tomorrow I'll try a bit of SDL stuff on it. Great job, Seb.
 
Ahh, good news ! It works now.


So I will switch to Lazarus for a few days. I'm stuck at PND'izing. Probably some problem with my run script. Lazarus launch, but has no right to write to the home folder I created... Weird, I have to debug. And I also have to modify a but the PND, to move all samples to the home/projects folder, and also create a default project for lazarus.


I don't know if this will work well, as lasarus seems to expect the whole lazarus folder to be writeable...


I will open a new thread when done (I think I will open the thread in the C/C++ section, I don't see another section in the dev that fit Pascal IDE).


For Code::Block, I have some kind of readmap anyway.


For now, I want to add (I order of priority) :

  • A clean exit, with a default ldconfig when quitting Code::Block (but the sudo thing is not cool, have to try without sudo)
  • Add the Valgrind runtime, I want to hunt memory leak on my programs ;-)
  • Take a look at SFML. I have seen a Wizard exist in Code::Block, I will look at what it expect to run.
  • move from wxWidget 2.8.12 to 2.9.4
  • move to a svn branch of Code::Block (and compile with wxWidget 2.9)


Other things I'm not sure about :

  • Add sge2d libraries (I tried it and found it quite simple to use, and it works on the Pandora with almost no modification). But it doesn't have to be include in the pnd to work, so I'm not sure of the need for that.
  • Add some kind of script to gather all dynamic librarie for a program you compile that are not in the default OS (basic algorythm: I need a tool that list the dynamic libraries use by a program, ldd probably, then if the file cannot be found in the default folder, copy it from the codeblocks extented lib folder, there are some samples doing thinks like that floating on the net, so it should be doable)
  • Add a Wizard or Plugin to manage PXML file (don't hold your breath on that)
  • Add a Wizard or Plugin to create PND (way more difficult I think, and useless without the 2 previous points).


Feel free to comment on the roadmap.
 
Last edited by a moderator:
For Code::Block, I have some kind of readmap anyway.


For now, I want to add (I order of priority) :

  • A clean exit, with a default ldconfig when quitting Code::Block (but the sudo thing is not cool, have to try without sudo)

I know what you mean about trying to avoid sudo - an alternative way of implementing cdevtools would have been a chroot, but I didn't want to be asking for a password every time.


Currently, cdevtools only does 'sudo ldconfig' once every reboot - this is the minimum I could get. It needs 'sudo' because ldconfig writes a file (ld.so.cache) in /var/run/, which is owned by root, and re-created on each restart. You could possibly add another script to the user's OS, which executes after /var is populated but before it stops operating as root, to change the file permissions, but it was the kind of thing I wanted to avoid doing.


However, the reason I went with ldconfig (over something like LD_LIBRARY_PATH) is that it helps the loader find the libraries regardless of how programs are called (with LD_LIBRARY_PATH, a console command like 'gcc hello.c' will work, but a 'configure' script fails at the 'making sure compiler works' stage. I'm assuming that Code::Blocks projects doesn't use things like configure scripts, so you may be able to get away with just 'export LD_LIBRARY_PATH=$CDEVROOT/usr/lib' in your startup script, and not bother with ldconfig at all.
 
Thank you freamon for the explanation.


For the LD_LIBRARY_PATH, ok, I will try with only that (in fact, it was partialy setup, just missing the wxWidget lib folder). Not sure it will be enough :wacko:


For now, I've taken your code for ldconfig part (I am learning a not of Linux thing lately :blink: ).
 
Lunchtime update - Just did a quick 'n' dirty SDL and SDL_Image test. A .png file was successfully displayed. Next test I shall import my CodeBlocks Pandora test project from my laptop when I get home.


Handy tip - In "settings -> Environment -> View" you can select "Auto show/hide message pane" to buy a good chunk of screen real estate. There are additional options that allow you to keep it open when doing search-in-files or after encountering build warnings/errors. You can also open/close it any time with F2.
 
Hey, good tip Loonie ! I think I will mention it in the "front page" of the repo, with the line mentioning toolbars have benn reduced so Main/Build/Debug fit in a line.
 
Ok, new release in the repo


Update v1.03.04 contains:

  • Added more library. The size of the PND is more than 200Mb now.
  • 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.
  • 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




I need help for Valgrind. It doesn't work, because (I may I miss an export somewhere, I will find it), but mainly, even if it launch, it doesn't find debug info for ld.so, and can't run without them.


I have no clue on how to get or generate this think. If a Ninja Linux guy could help here :ph34r: !
 
Last edited by a moderator:
Error when compiling with this version:

/mtn/utmp/codeblocks/usr/bin/../libexec/gcc/arm-angstrom-linux-gnueabi/4.3.3/ccplus: error while loading shared libraries: libmpfr.so.4: cannot open shared object file: No such file or directory
 
:( sorry for that


I am trying to rebuild gcc compiler, with a rpath adapted to the codeblock pnd... But it takes time. In the mean time, you could launch the "pre-configuration.sh" shell script from the command line, for a temporary fix, or downgrade to previous PND.
 
Ok, new fixed PND in the repo


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
 
Same error with this version, I'm afraid. Pesky libmpfr.so.4
 
:wacko: oh, I tested it many times. I forgot to remove the .so from the NAND I suppose, so the tests where good? I was sure I had done that, with the post-configure.sh script (or may be this one is buggy)?


Well, back to more testing and PND Packaging then.
 
I've avoided that workaround, to keep the testing as vanilla as I can. Wish I had kept the older PND though.


Anyway, your efforts are greatly appreciated.
 
I double checked and clearly don't understand what is happenning ?!!


I don't have the .so files in my NAND, there where revoved. And I checked (using the command line of the PND), where are dynamicly linked the so of the cc1plus program (using ldd /mnt/utmp/codeblocks/usr/libexec/gcc/arm-angstrom-linux-gnueabi/4.3.3/cc1plus and I see it's the so files installed on /mnt/utmp/codeblocks/usr/lib


Can you: reboot your pandora, try again Code::Blocks, confirm that the "sudo ldconfig blabla" is correctly launching (it ask for your password), and also try with the command line a ldd on the cc1plus to see what is use as /so files ?
 
Last edited by a moderator:
Tried rebooting again, there is no sudo anything happening, no terminal, all that happens is the IDE loads. I guess ldconfig is not launching at all. Should it be working as before, with the terminal window popping up?
 
Yes, it should appear as before. Maybe this is the problem. Why the terminal doesn't popup ?! It pop's on my pandora, I rebooted many time and it worked each time. That's strange. But this must be the problem, without the ldconfig, it can't work.


I will copy / paste the script I used...
 
Back
Top