Welcome, Guest. Please login or register.

Author Topic: C programming must-haves  (Read 3712 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline kamigaTopic starter

  • Full Member
  • ***
  • Join Date: Oct 2005
  • Posts: 165
    • Show only replies by kamiga
C programming must-haves
« on: March 30, 2008, 05:55:21 PM »
I've read most of the recent posts here.  A fair bit of the links including in them are now dead, and it's only been a few months.

I'm familiar with C, C++, Java, etc on the PC platform.  Good (free) compilers, IDEs, documentation, etc are all over the place for PC setups.

I'm interested in programming an A500 in C, which currently has KS3.0/WB3.1 on it.

Compilers: Use SAS/C? What's the latest available version?

Documentation on APIs etc?  I have Libraries and Devices RKM.  Is there an official place to get documentation?

Example code anyplace?

Any active Amiga programming communities, forums, websites?

Anything else I need to know to get started?

Required books?

Thanks

Keith
 

Offline alexh

  • Hero Member
  • *****
  • Join Date: Apr 2005
  • Posts: 3644
    • Show only replies by alexh
    • http://thalion.atari.org
 

Offline kas1e

Re: C programming must-haves
« Reply #2 on: March 30, 2008, 06:23:23 PM »
The best amiga programmer forum: http://utilitybase.com/
the best C compiler for amiga and amiga like system, as said alexh - vbcc.
 

Offline SamuraiCrow

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2281
  • Country: us
  • Gender: Male
    • Show only replies by SamuraiCrow
Re: C programming must-haves
« Reply #3 on: March 31, 2008, 03:09:40 AM »
The only thing missing from the current versions of VBCC is the lack of optimization of the switch statement and the fact that VBCC is not a C++ compiler.

GCC is also free and has those features added on but it is a pain to use.

SAS/C is extremely old and is only better than the others with regard to its source level debugger.  The loops and the order of operations in an expression is all suboptimal code generation.  All other features go to the other compilers.

So take your choice of compilers and let us know what you think.
 

Offline Ami603

  • Full Member
  • ***
  • Join Date: Jul 2002
  • Posts: 180
    • Show only replies by Ami603
Re: C programming must-haves
« Reply #4 on: March 31, 2008, 07:43:16 AM »
I'd say go for the easiest compiler installation,however bad optimizations it may produce and start messing with coding,you can always switch to a better
compiler once you're used to AmigaOS API's and stuff to improve on executable results
AmigaOne X1000
 

Offline Caius

  • Sr. Member
  • ****
  • Join Date: Nov 2007
  • Posts: 294
    • Show only replies by Caius
Re: C programming must-haves
« Reply #5 on: March 31, 2008, 11:04:00 AM »
Quote

kamiga wrote:
Documentation on APIs etc?  I have Libraries and Devices RKM. Is there an official place to get documentation?

The Amiga Developer CD v2.1 is the official place to get documentation. It's updated for AmigaOS 3.5 (not 3.9). In addition to the RKMs you get a bunch of examples, historic documentation, some useful tools, etc. Unfortunately it's really badly organized. But I still think it's worth having. You can get it from amigakit or Vesalia. Possibly from other places as well.

Personally I use StormC4 for C++ coding. It's far from perfect, but I really like the project management features.
Theology is just a debate over who to frame for creating reality.
 

Offline Spellcoder

  • Newbie
  • *
  • Join Date: Dec 2005
  • Posts: 4
    • Show only replies by Spellcoder
    • http://www.spellcoder.nl
Re: C programming must-haves
« Reply #6 on: March 31, 2008, 12:30:21 PM »
I've got a few links to C related tutorials/references on amigacoding.com. Not many yet, but it might help. They're on this page: http://www.amigacoding.com/index.php/C:Resources
Bachelor of Art & Technology
http://www.spellcoder.nl (my Hideout)
http://www.amigacoding.com
 

Offline bburtonpa

  • Newbie
  • *
  • Join Date: Sep 2006
  • Posts: 20
    • Show only replies by bburtonpa
Re: C programming must-haves
« Reply #7 on: March 31, 2008, 06:09:15 PM »
> Compilers: Use SAS/C? What's the latest available version?

For native Amiga apps, SAS/C is the only way to go.  To my knowledge, it is also the only compiler that you can use to create a shared function library (similar to a dll).  

In addition to the other links that people have provided, you may also want to take a look at this site:

http://amidevcpp.amiga-world.de/

This is a very nice IDE with support for both the Amiga and AROS.  

Be aware that C++ apps, even when generated by SAS/C, will be huge.  Just for fun, I've coded some console apps using the C++ standard library using vectors, lists, streams, etc.  Talk about MAJOR code bloat, a simple hello world app can go from a few thousand (a few HUNDRED if you know what you're doing) bytes to well over 400,000!  Stick with asm or C.

> Documentation on APIs etc? I have Libraries and Devices RKM. Is there an official place to get documentation?

No OFFICIAL place to get documentation.  The autodocs are handy, but not absolutely necessary.  The RKM:Libraries manual that you already have is the best place to start.

> Example code anyplace?

The RKM:Libraries manual is the first place to start.  It contains good examples for opening viewports, windows, screens, boopsi as well as tasks, messaging, etc.  I would then try Aminet/dev for additionl source code and examples.  It is a GREAT place to find code  in asm, C, E and Modula-2.  Although there is a lot of duplication, the Fred Fish (R.I.P. my friend) disks are also a good source for example code.

> Anything else I need to know to get started?

Just have fun... :-)



 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show only replies by Karlos
Re: C programming must-haves
« Reply #8 on: March 31, 2008, 06:12:22 PM »
Quote

bburtonpa wrote:
> Compilers: Use SAS/C? What's the latest available version?

For native Amiga apps, SAS/C is the only way to go.  To my knowledge, it is also the only compiler that you can use to create a function library (dll).  


StormC also has the ability to create amigaos shared library targets.
int p; // A
 

Offline bburtonpa

  • Newbie
  • *
  • Join Date: Sep 2006
  • Posts: 20
    • Show only replies by bburtonpa
Re: C programming must-haves
« Reply #9 on: March 31, 2008, 06:16:00 PM »
Spellcoder, NICE wiki...
 

Offline Kronos

  • Resident blue troll
  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 4017
    • Show only replies by Kronos
    • http://www.SteamDraw.de
Re: C programming must-haves
« Reply #10 on: March 31, 2008, 07:03:08 PM »
SAS's C++ part is pure crap, completly useless unless you have it on a very powerfull emulator. Actuall SAS doen't have a C++ compliler, it only has preprocceor spewing out gigantic pieces of C-code for even the simplest C++ code.

AFAIK even GCC can do libraries it may just not be that easy.
1. Make an announcment.
2. Wait a while.
3. Check if it can actually be done.
4. Wait for someone else to do it.
5. Start working on it while giving out hillarious progress-reports.
6. Deny that you have ever announced it
7. Blame someone else