OESF | ELSI | pdaXrom | OpenZaurus | Zaurus Themes | Community Links | Ibiblio

IPB

Welcome Guest ( Log In | Register )

2 Pages V   1 2 >  
Reply to this topicStart new topic
> On Z Developement, Newbee
edsav00
post Dec 13 2004, 08:14 AM
Post #1





Group: Members
Posts: 5
Joined: 6-December 04
Member No.: 5,809



Hi;

Please go easy on me. I need someone to hold my hand with this. I'm new to the Zaurus and Linux. I'm taking C++ programing and would like to install a compiler on my sl-5600 zaurus. I've tried installing zgcc 2.95.1 with no luck and dev_img-1.5 with no luck either. Can someone please tell me what to install and how to install it (simplicticly).

Thank you in advance,

Ed the NEWBEE
Go to the top of the page
 
+Quote Post
kopsis
post Dec 13 2004, 10:34 AM
Post #2





Group: Members
Posts: 329
Joined: 1-July 04
Member No.: 3,880



I've found that I prefer ZGCC -- mainly because the installation is less intrusive and easier to clean up should you decide you want to remove it later. If you'd rather go the dev-img route, perhaps someone else can offer guidance on that.

Prerequisites:

The first thing you should do is get the latest ZGCC from this site. You'll need both the binaries image and the include files image. If you got ZGCC from some other site, it may not be the latest version and the instructions below may not work.

You're also going to need an SD card to put this stuff on (cramfs images cause all kinds of problems if you mount them from CF and then suspend your Z). You'll need enough free space for both images (minumum 9MB). The card does not have to be ext2/ext3 formatted -- FAT16/FAT32 will work just fine.

You have an SL-5600 so you shouldn't have to worry too much about your ROM version (unless you're using OZ ... then you'll have to find an OZ person to advise you).

You will have to do a bunch of command line stuff, so you need to have a terminal program (such as EmbeddedKonsole) installed.

Instructions:

Put both images in the root of your SD card and then follow these instructions carefully. You'll most likely want to use the steps described under Option 1 then do the steps under Configuring the Compiler. The process is not simple, but the instructions are very good and if you follow them exactly, everything will work fine. If you have problems, post the details of the step that's tripping you up and the results you're getting, and I'll try to offer suggestions.

Caveats:

Note that there are no fancy IDEs to hold your hand when you're developing C/C++ on the Zaurus. It's good old-fashioned command line development. I don't know how they teach programming courses these days, but the majority of inexperienced programmers I meet seem to be completely lost without a GUI. You're going to have to write your source code in a text editor, save it, then go to a command shell and use a command like "gcc -o foo -lm foo.c" to build your program. If it doesn't work, you'll have to debug the hard way by sprinkling your code with debug printf statements or the slightly-less-hard way by using the GNU debugger (GDB). Don't get me wrong, all this stuff is perfectly usable and I actually prefer developing with command line tools, but it could be tough for a beginner (just learning C++ well is enough to tax most mortal humans smile.gif ).
Go to the top of the page
 
+Quote Post
edsav00
post Dec 13 2004, 01:15 PM
Post #3





Group: Members
Posts: 5
Joined: 6-December 04
Member No.: 5,809



Kopsis;

I just wanted to thank you for taking the time to respond back with such great detail. Once I get home from work I'm going to attempt it again. Actually the first intro course off c++ that I’m taking uses a GUI Borland compiler. The second advanced course uses Solaris and g++. Can you recommend any resources for learning g++ and or gcc? Thanks again, if there were more people like you the world would be a better place.

-Ed
Go to the top of the page
 
+Quote Post
kopsis
post Dec 13 2004, 04:26 PM
Post #4





Group: Members
Posts: 329
Joined: 1-July 04
Member No.: 3,880



No need to thank me ... I'm just trying to pay back ZUG karma smile.gif I've gotten a ton of good knowledge from other folks here so I try to return the favor when I can.

As for references, if you're learning C++, stay away from C books because they'll teach you bad habits. For C++ one of my favorite general references (though it's not gcc/g++ specific) is the Thinking in C++ two volume series by Bruce Eckel. I recommend it partly because it's quite good and partly because there's a free electronic version available. Put a copy on your Zaurus along with ZGCC and you have a complete mobile C++ programming lab smile.gif

For g++ there's a decent g++ tutorial here and it contains links to some others such as a Linux commands tutorial. It's pretty basic, but that's what you want to get started. For the GNU Debugger (gdb) there's a good tutorial here. The GNU development tools gcc/g++/gdb contain a mountain of features that are documented in the man pages and online references, but it will likely be a while before you need even 1% of the features the tools have to offer smile.gif
Go to the top of the page
 
+Quote Post
edsav00
post Dec 15 2004, 09:32 AM
Post #5





Group: Members
Posts: 5
Joined: 6-December 04
Member No.: 5,809



Kopis;

The instruction are asking me to write a script in my $PATH. How do I find $PATH?
Should I be loged in as root (su) are as someone else when doing these procedures. What do I use to write the script (vi or notepad)? Like I said earlier I'm new to this, the procedure is making the assumption that there is an understanding of linux and or unix. In which I know just enough to get myself in to trouble.

Thanks,

-Ed
Go to the top of the page
 
+Quote Post
kopsis
post Dec 15 2004, 12:00 PM
Post #6





Group: Members
Posts: 329
Joined: 1-July 04
Member No.: 3,880



$PATH is an environment variable that contains a list of directories that are automatically searched to find executables and scripts. When the instructions want you to do is write a script and put it in one of those directories. You can see what directories are in your path by doing and "export" at a shell prompt. However, I can tell you right now that the best place to put the script is /opt/QtPalmtop/bin. You will need to be root ("su" at the shell prompt) to write into that directory.

Your best bet for an editor is vi since it's guaranteed not to do anything strange with file names, end of line characters, etc. So the sequence of operations for this step is:
CODE
$ su
# cd /opt/QtPalmtop/bin
# vi mntzgcc.sh

If you haven't used vi before, the minimum you need to know is:
  • Hit "i" to get into insert mode
  • Type in the script
  • Hit "Cancel" (ESC) to get out of insert mode
  • Enter "ZZ" (two uppercase Zs) to save the file and exit
Or, if you're doing the cramfs install to SD and prefer the easy way out ... smile.gif

Grab this IPK and install it and it will create all the scripts for you. This IPK assumes that you've put the two cramfs files in the root of your SD card. If you're trying to do an uncompressed install, you're on your own.

My IPK also has a couple of improvements in the mntzgcc.sh script. First, it automatically checks for the loop devices and creates them if they don't exist. This is handy on Sharp ROMs that only start with 2 loop devices after a reboot. The other thing is it allows you to easily unmount the zgcc filesystems. Just do a "mntzgcc.sh u" as root to unmount. You need to unmount anytime you want to eject your SD card.

Note that the mntzgcc.sh script in this package is executable so you don't have to "source" it, just run the script directly by entering "mntzgcc.sh" as root at a shell prompt. The zgcc.sh script on the other hand always has to be "sourced" (as described in the zgcc instructions).
Go to the top of the page
 
+Quote Post
ArchiMark
post Jan 30 2005, 07:06 PM
Post #7





Group: Members
Posts: 1,026
Joined: 25-June 03
From: Silicon Valley
Member No.: 208



QUOTE(kopsis @ Dec 15 2004, 12:00 PM)
[SNIP]

Or, if you're doing the cramfs install to SD and prefer the easy way out ... smile.gif

Grab this IPK and install it and it will create all the scripts for you. This IPK assumes that you've put the two cramfs files in the root of your SD card. If you're trying to do an uncompressed install, you're on your own.

My IPK also has a couple of improvements in the mntzgcc.sh script. First, it automatically checks for the loop devices and creates them if they don't exist. This is handy on Sharp ROMs that only start with 2 loop devices after a reboot. The other thing is it allows you to easily unmount the zgcc filesystems. Just do a "mntzgcc.sh u" as root to unmount. You need to unmount anytime you want to eject your SD card.

Note that the mntzgcc.sh script in this package is executable so you don't have to "source" it, just run the script directly by entering "mntzgcc.sh" as root at a shell prompt. The zgcc.sh script on the other hand always has to be "sourced" (as described in the zgcc instructions).
[


Thanks for your providing the IPK..

Installed zgcc per your instructions and zgcc instructions....

However, not quite there yet...

Would greatly appreciate some help to finish up please!

What directory do I need to be in order to compile?

Now when I try to test compiling, I get message "gcc: not found".

Thanks for any input!

Mark
Go to the top of the page
 
+Quote Post
freizugheit
post Jan 30 2005, 07:39 PM
Post #8





Group: Members
Posts: 409
Joined: 7-November 03
Member No.: 811



ArchiMark,

Upon successful installation, you should have two directories, namely .zgcc and .include with all files included. If no files are found, i.e. the installation was not successful.

Try using "souce mntzgcc.sh" and post the contents of env here by issuing the following command:

env > env.tx
Go to the top of the page
 
+Quote Post
ArchiMark
post Jan 31 2005, 07:22 AM
Post #9





Group: Members
Posts: 1,026
Joined: 25-June 03
From: Silicon Valley
Member No.: 208



QUOTE(freizugheit @ Jan 30 2005, 07:39 PM)
ArchiMark,

Upon successful installation, you should have two directories, namely .zgcc and .include with all files included.  If no files are found, i.e. the installation was not successful.

Try using "souce mntzgcc.sh" and post  the contents of env here by issuing the following command:

  env > env.tx


Thanks for your freizugheit!

Well....as usual, strange situation...those 2 directories are there on my SD card, but empty now. I know I saw files in them yesterday. However, my C3000 did freeze up last night and did have to reboot...

Tried using 'source mntzgcc.sh' and response was 'source: not found'.

No response to 'env > env.tx'.....

blink.gif

Any suggestions?

Since I have a C3000 with lots of storage should I try the uncompressed install method or wait till I get this situation working first?

Thanks,

Mark
Go to the top of the page
 
+Quote Post
ArchiMark
post Jan 31 2005, 10:41 AM
Post #10





Group: Members
Posts: 1,026
Joined: 25-June 03
From: Silicon Valley
Member No.: 208



UPDATE:

Managed to get things working such that I can report on the 'env.tx' file says.....

LOGO = 1
DEFYEAR = 2005
MACHTYPE = arm-unknown-linux-gnu
USER = zaurus
CONSOLE = /dev/console
HOSTNAME = zaurus
SHLVL = 1
HOME = /home/root
EQUIPMENT = 4
QTDIR = /home/QtPalmtop
CRL_DIC_PATH = /home/QtPalmtop/dic
UNICODEMAP_JP = open-19970715-ms, cp932, nec-vdc, ibm-vdc, udc
COLORTERM = 0
QPEUSER = zaurus
QPEGROUP = qpe
INITVERSION = sysvinit-2.78
LOGNAME = zaurus
_ = mntzgcc.sh
LOGOLANG = 1
TERM = vt100
LAUNCH = q
PATH = /home/QtPalmtop/bin:/root/bin:/bin:/sbin:/usr/bin:/usr/bin:/usr/local/bin
RUNLEVEL = 5
PREVLEVEL = N
LANG = en
SHELL = /bin/sh
QWS_DISPLAY = Transformed:Rot270:Vga:0
OSTYPE = linux-gnu
QPEDIR = /home/QtPalmtop
PWD = /home/zaurus
TZ = America/LosAngeles
HOSTTYPE = arm
RTC_RESET = 1

Also, I do see files in the '.include' and '.zgcc' directories.....

However, when I try typing 'source zgcc.sh' I get message 'source zgcc.sh: Not found'. How can I get this working?

Hope this helps!

Thanks,

Mark

This post has been edited by ArchiMark: Jan 31 2005, 10:58 AM
Go to the top of the page
 
+Quote Post
ArchiMark
post Jan 31 2005, 06:29 PM
Post #11





Group: Members
Posts: 1,026
Joined: 25-June 03
From: Silicon Valley
Member No.: 208



UPDATE:

OK, don't know why, but now zgcc seems to be working I think.... blink.gif

Maybe it's because I turned off my Z and turned it back on....who knows??... rolleyes.gif

I tried compiling a test file and I get compiler error messages. So it seems to be working now.

Now, hopefully, I can fix those errors and actually get something to compile properly!

Thanks,

Mark
Go to the top of the page
 
+Quote Post
freizugheit
post Jan 31 2005, 07:02 PM
Post #12





Group: Members
Posts: 409
Joined: 7-November 03
Member No.: 811



If Zgcc is working, the Path should show:

PATH = /mnt/card/.zgcc/bin:/home/QtPalmtop/bin:/root/bin:/bin:/sbi
n:/usr/bin:/usr/bin:/usr/local/bin

If it does not show the .zgcc/bin in the PATH string, you need to activate "source zgcc.sh" again.
Go to the top of the page
 
+Quote Post
ArchiMark
post Feb 1 2005, 09:13 AM
Post #13





Group: Members
Posts: 1,026
Joined: 25-June 03
From: Silicon Valley
Member No.: 208



OK, got it, Freizugheit!

I see my PATH as you showed it:

PATH = /mnt/card/.zgcc/bin:/home/QtPalmtop/bin:/root/bin:/bin:/sbi
n:/usr/bin:/usr/bin:/usr/local/bin

UPDATE:

Just tested and successfully compiled a test app!!

Now just need to install Perl per the instructions to automate the build process using 'tmake' and I'm all set I think.... cool.gif

Thanks again for your help!!

Mark

This post has been edited by ArchiMark: Feb 1 2005, 01:15 PM
Go to the top of the page
 
+Quote Post
freizugheit
post Feb 1 2005, 07:53 PM
Post #14





Group: Members
Posts: 409
Joined: 7-November 03
Member No.: 811



I think perl 5.80 should be in /mnt/card after successful installation.
Go to the top of the page
 
+Quote Post
ArchiMark
post Feb 1 2005, 08:14 PM
Post #15





Group: Members
Posts: 1,026
Joined: 25-June 03
From: Silicon Valley
Member No.: 208



That's good to know, freigzugheit!

Definitely saves some time installing Perl...

However, looked on /mnt/card and don't see it...checked various directories....

Meanwhile....had to reboot my Z this afternoon.

So do I have to run 'mntzgcc.sh' and 'zgcc.sh' again?

If so, then given that I have a C3000 with all that storage space, I should try doing an 'uncompressed install' on the Z.....

Thanks,

Mark

This post has been edited by ArchiMark: Feb 1 2005, 09:04 PM
Go to the top of the page
 
+Quote Post

2 Pages V   1 2 >
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 27th November 2014 - 01:27 AM