Welcome, Guest. Please login or register.

Author Topic: Which C Compiler?  (Read 3181 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline GeneraleTopic starter

  • Full Member
  • ***
  • Join Date: Feb 2005
  • Posts: 233
    • Show only replies by Generale
    • http://members.dodo.com.au/~izabellion
Which C Compiler?
« on: March 11, 2005, 04:47:51 AM »
Hi there!

Can anyone recommend a C compiler package for the bog standard amigas? ie A500. Just looking for something simple to set up so I can experiment with programming on an Amiga. The simpler the better. Just need the basic set of tools, libs and headers. I don't need the resources to write the next killer app!
I suppose it's wishful thinking to find one in ADF format.

I know there's an abundance of them on aminet, but I don't know which ones!!!

Any help would be great. Thanks  :-)
A500 (salvo): 1Mb RAM (512k chip, 512k SlowFast)
1x880k Floppy Disk, 1xIBM 540Mb 3.5\\"HDD KS1.3, WB1.3
1084S monitor. AT Keyboard!
A500 (Whitey): 512k RAM, 1x880k Floppy Disk, KS1.2, WB1.3
 

Offline Castellen

Re: Which C Compiler?
« Reply #1 on: March 11, 2005, 08:26:41 AM »
I use SAS/C 6.58 a lot and find it really good.

Once you get used to the GUI, it's quick and easy to use.
The debugger works well too.

It'd be worth buying a 2nd hand copy which has the printed manuals.  I find the function library documentation essential.


Would be beyond a bog standard A500 to run the SAS/C package, but you can certainly compile apps for the A500 using a higher spec machine.


Of course there are a bunch of other compilers including GCC (freeware?) and Storm C (from H&P).  Most of the compilers available would probably do the job OK.
 

Offline realstar

  • Jr. Member
  • **
  • Join Date: Apr 2003
  • Posts: 93
    • Show only replies by realstar
    • http://members.shaw.ca/realstar
Re: Which C Compiler?
« Reply #2 on: March 11, 2005, 11:09:15 AM »
Sas/C is a great 68k compiler but a little
hard to find now. If you are using UAE
(since you asked about an adf) or a slightly
upgraded machine you could probably use VBCC.
VBCC is newer, freeware and a good cross-compiler.
GCC is decent too but will take extra effort
to install and setup. You may have to obtain
the AmigaOS include files seperately from the
compiler, they are included in the Amiga NDK
(Native developer's kit) which has been
available online at various times or on CD.

 

Offline Fats

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 673
    • Show only replies by Fats
Re: Which C Compiler?
« Reply #3 on: March 11, 2005, 07:37:14 PM »
Quote

realstar wrote:
GCC is decent too but will take extra effort
to install and setup.


From what I remember gcc takes a lot of memory. Certainly not something for a standard A500.
Trust me...                                              I know what I\'m doing
 

Offline SamuraiCrow

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2281
  • Country: us
  • Gender: Male
    • Show only replies by SamuraiCrow
Re: Which C Compiler?
« Reply #4 on: March 11, 2005, 08:17:29 PM »
If you have to run it in one megabyte or less pick a crappy unoptimizing compiler like DICE otherwise download the latest version of VBCC.  I'd only recommend looking at GCC if you're interested in C++ or porting Linux apps.
 

Offline GeneraleTopic starter

  • Full Member
  • ***
  • Join Date: Feb 2005
  • Posts: 233
    • Show only replies by Generale
    • http://members.dodo.com.au/~izabellion
Re: Which C Compiler?
« Reply #5 on: March 12, 2005, 01:43:20 AM »
Thanks for the input all.

It' is an A500 w/1mb ram that I'd be using.
As for ADFs, it's just easier to transfer is all.

I'd love to use UAE as well, but I have a little problem with that. Well, a couple:
I'm only using a p200.
and, my OSes are NT4.0 (unsupp'd by winUAE) and RH linux 7.3.
Becuase the UAE source is broken I'm a little stuck. Don't suppose anyone has a copy of cpu_prefetch.h they can send me?  
It's too slow d/ling various versions of UAE looking for it.

Hopefully I'll have a hard drive set up in the next few days (If I've found all of my &^%$@^ mistakes), which will help matters a bit.

A plain old commandline is fine as an interface. GUIs are a nice bonus though. I'm kind of used to using CC/GCC anyway.
A500 (salvo): 1Mb RAM (512k chip, 512k SlowFast)
1x880k Floppy Disk, 1xIBM 540Mb 3.5\\"HDD KS1.3, WB1.3
1084S monitor. AT Keyboard!
A500 (Whitey): 512k RAM, 1x880k Floppy Disk, KS1.2, WB1.3
 

Offline SamuraiCrow

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2281
  • Country: us
  • Gender: Male
    • Show only replies by SamuraiCrow
Re: Which C Compiler?
« Reply #6 on: March 12, 2005, 03:36:56 AM »
There's always EUAE for Linux found here with source on the same site... and definitely better than the old UAE sources it is based on.  It even has a version of the JIT engine borrowed from WinUAE.

That should be enough to get VBCC or GCC to work.  (I don't like to see unoptimized code floating around.)
 

Offline GeneraleTopic starter

  • Full Member
  • ***
  • Join Date: Feb 2005
  • Posts: 233
    • Show only replies by Generale
    • http://members.dodo.com.au/~izabellion
Re: Which C Compiler?
« Reply #7 on: March 12, 2005, 05:12:17 AM »
Downloading e-uae now...
It's smaller than UAE. Weird.

On a little aside, I've nearly finished the a500ide. Just need to finish connecting the grounds from the connectors. I hate using proto boards! Just hope all the connections are right  :-( ...Oh no...should have pulled the key pin. *cough* anyway, once that's up and running, I'll grab some of the suggested compilers.
Then it's "Hello World!" time!
A500 (salvo): 1Mb RAM (512k chip, 512k SlowFast)
1x880k Floppy Disk, 1xIBM 540Mb 3.5\\"HDD KS1.3, WB1.3
1084S monitor. AT Keyboard!
A500 (Whitey): 512k RAM, 1x880k Floppy Disk, KS1.2, WB1.3
 

Offline GeneraleTopic starter

  • Full Member
  • ***
  • Join Date: Feb 2005
  • Posts: 233
    • Show only replies by Generale
    • http://members.dodo.com.au/~izabellion
Re: Which C Compiler?
« Reply #8 on: March 12, 2005, 06:04:29 AM »
tried compiling e-uae. won't do it.reckons there's a problem with joystick.c in /jd-linuxold on line 118. Reckons there's a parse error before 'char'. Went through and I couldn't see anything wrong though. As near as I could tell, everything's been declared and every opened thing has been closed. I hate these errors!
I don't even want stick support!! I don't know how to remove it though. Grr.

...1/2 hour later:
Crippled the init code so it thinks that there's no joysticks without looking. My comp seems to have a problem with char
  • structures. Or at least that one. Weird. Will look into it properly later.
A500 (salvo): 1Mb RAM (512k chip, 512k SlowFast)
1x880k Floppy Disk, 1xIBM 540Mb 3.5\\"HDD KS1.3, WB1.3
1084S monitor. AT Keyboard!
A500 (Whitey): 512k RAM, 1x880k Floppy Disk, KS1.2, WB1.3
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16882
  • Country: gb
  • Thanked: 6 times
    • Show only replies by Karlos
Re: Which C Compiler?
« Reply #9 on: March 12, 2005, 01:38:35 PM »
For any serious work you will need a slightly expanded system to compile any moderate sized program.

At the very least I'd reccomend a hard disk, and an accelerator of some kind, prefereably with a fair chunk of memory.


Regardinng your char
  • problem, it depends where you put it.


char x[1024];

main()
{

}

Here the array is a global entity that is allocated on the free store when the code is loaded.

main()
{
char x[1024];
}

Here the array is an automatic entity that is allocated on the stack when main() is entered.

If you allocate large arrays in this style, you'll quickly overflow your stack.
int p; // A
 

Offline GeneraleTopic starter

  • Full Member
  • ***
  • Join Date: Feb 2005
  • Posts: 233
    • Show only replies by Generale
    • http://members.dodo.com.au/~izabellion
Re: Which C Compiler?
« Reply #10 on: March 13, 2005, 12:15:50 AM »
This is the bit of code in joystick.c that trips it over:

static int init_joysticks(void)
{
    nr_joysticks = 0;
    js0 = -1; js1 = -1;
    char js_path[JS_MAXPATHLEN]; // temporary buffer for device name


Oh yeah, JS_MAXPATHLEN is defined as 20. and nr_joysticks, js0 and js1 are global. I can see no reason whatsoever why js_path should break.
I mean a whole lot of other people have used the latest version of E-UAE without probs, but it doesn't like this comp. Compiled fine after I crudely doctored the code (Like I said, don't care about sticks anyway).

Back to topic:

After I finish this post I'll be putting the last few wires on my IDE controller, so I'l have a hard disk (if it works), and unfortunately I can't see myself getting an accelerator card. They cost $$$. heh, unless someone wants to swap one for some 8-bit hardware, I haven't got a hope!

Well, after the controller is tested, I'll have a look at the various C software.
A500 (salvo): 1Mb RAM (512k chip, 512k SlowFast)
1x880k Floppy Disk, 1xIBM 540Mb 3.5\\"HDD KS1.3, WB1.3
1084S monitor. AT Keyboard!
A500 (Whitey): 512k RAM, 1x880k Floppy Disk, KS1.2, WB1.3