Native Development help


Fworg64

Who knows?
Joined
Apr 27, 2011
Messages
196
Location
Fargo, ND
not sure if this is the right section, but i do need help


how do i set up native compilation on my pandora?


in the end what i want is to use codeblocks and allgro5 and have it all set up ao i simply need to code and hit build.


what ive dne so far is ive ran fraeamons c/c++ dev tools and then ran code blocks, codebocks did not find any compilers and neither could i, until i looked into the utmp folder while freamons app was running, that dissepeared when i quit the app. And i did find 2 textfiles, in my app data folder on my sd card, named gcc and g++ that containded the path where i found both of them in the utmp dir along with some command looking things.


so i guess what im aftr is how do i setup a toolchain with codeblocks? Or Something.


btw i did some searching through the forums about compiling bollocks style but have yet to find a cut and dry guide


any help is apreaciated
 
You need to start the cdevtools pnd and then minimise it - keep it running in the background. Then start the codeblocks pnd and set the path for the compiler to /mnt/utmp/cdevtools/usr/bin/arm-angstrom-linux-gcc.


I'll download codeblocks now and give a more complete answer after I've played with it.
 
thamk you so much! it is about 1am so i may be headed to bed soon but i will fiddle with this toorow for sure.


semi unrelated but codeblocks also complained about not bieng able to save the files on my sd card...


saving problem solved by running as root B)
 
Last edited by a moderator:
found substitute program for all but stattic linker abd resource compiler, tried compiling a c++ helloworld and got the folowing errors


also goin to sleep thanks for the help


zzzz..zzz.zzzz
 

Attachments

  • errors.txt
    233.6 KB · Views: 118
Last edited by a moderator:
I work nights so I think I went to sleep the same time as you. Here's a proper answer now I've woke up again:


Firstly, no-one's compiled allegro5 yet - the best we've got is 4.4.1.


If that's not a dealbreaker, here's how I compiled Sword of Forgoal (chosen 'cos it's an allegro game and I know it works on the pandora).


1) Find the pandora/appdata/cdevtools/init directory. Create a file called 'cdevspecsfile' and paste the following into it:



Code:
%rename cc1		original_cc1


*cc1:

%(original_ccl) -I/mnt/utmp/cdevtools/usr/include


%rename cc1plus		original_cc1plus


*cc1plus:

%(original_cclplus) -I/mnt/utmp/cdevtools/usr/include


%rename link		original_link


*link:

%(original_link) -rpath /mnt/utmp/cdevtools/usr/lib



2) open up the 'gcc' file (also in the init directory) and replace the contents with



Code:
arm-angstrom-linux-gnueabi-gcc -specs ../../init/cdevspecsfile "$@"



3) open up the 'g++' file (also in the init directory) and replace the contents with



Code:
arm-angstrom-linux-gnueabi-g++ -specs ../../init/cdevspecsfile "$@"


This is what build 38 of the cdevtools pnd does on startup, but I haven't uploaded it yet (needs more testing). If the above doesn't make sense, it's probably easiest to wait a day and download the new version of the pnd.


4) Start up the cdevtools pnd and leave it open


5) Start up code:blocks. Choose 'GNU GCC Compiler' as default. Go to Settings->Compiler and Debugger settings.


6) In the 'Toolchain executables' tab, change the 'Compiler's installation directory' to '/mnt/utmp/cdevtools/usr'


7) In Program Files, leave the compiler and linker as 'gcc' and 'g++' (not the angstrom versions I said before)


8) In Additional Paths, add '/usr/bin' (this is for 'ar' mainly)


9) Click ok. Start a new console project. Add the files for sword of forgoal (the source was included in the pnd of that game).


10) Choose Project->Build Options. In the Linker Settings tab, add /mnt/utmp/cdevtools/usr/lib/liballeg.so as an absolute path. Click ok.


11) Choose Build->Build.
 
well thanks to you inow have a simple working c compiler that works with allegro 4, thank you, but when i try to compile a c++ hello world it claims that cout is not declared in this scope. I got a c hello world to compile and it runs fine from codeblocks but i think my linux noobness prevemts me from running it from the terminal or launching it from thunar. But i did get sword of fargoal (a c program) to compile and to launch from thunar just fine.


but i would love having a c++ compiler... please....
 
Might just be missing something from your source file.


How I compiled a c++ hello world and launched it from a terminal:


1) Started cdevtools pnd, and then codeblocks.


2) In codeblocks, I chose new project, console application, C++. I called my project 'hw' and saved it on '/media/mmcblk0p1' (my SD card). On the next screen I unticked Create Debug configuration but kept Create Release configuration as ticked. The 'output dir' section of the Release configuration shows 'bin/Release', so - putting it all together - my final executable will be /media/mmcblk0p1/hw/bin/Release/hw


3) Added a new file to the project called untitled.cpp and pasted this into it:



Code:
#include <iostream>

using namespace std;


int main ()

{

      cout << "Hello, world!" << endl;


      return 0;

}


4) Built it.


5) Opened a terminal. Did 'cd /media/mmcblk0p1/hw/bin/Release'. Typed './hw'. Resisted urge to say 'hello' back.
 
/megafacepalm - forgot "using namespace std;"


on the bright side it all works flawlessly now, thank you ever so much for your help!
 
Back
Top