Amiga.org
Operating System Specific Discussions => Amiga OS => Amiga OS -- Development => Topic started by: redrumloa on February 24, 2008, 12:05:06 AM
-
Please see this thread (http://landover.no-ip.com/forums/index.php/topic,2139.0.html).
I am using 'Super C' for the Commodore 128, it is a standard c based on K&R so I figure one of you Amiga guys could help :-?
-
hmm,
You could try using printf, not print.
But since I have never used "Super C", I could be wrong, but most C compilers use printf.
Basically the linking error is it saying that it doesn't know of any methods that has the name "print".
Ie, no external definition, is it saying there is no difinition of "print" in the headers you linked with.
-
stdio (http://en.wikipedia.org/wiki/Stdio.h) has no "print" function.
Also, getchar() works different ways on different systems, if you use it to "pause until user hits a key" that is.
-
What you are going to have to do is to write a separate print function that uses printf to print that stuff and compile it together with the program. Then, you'll need some pointers and I think a graphing calculator. ;-)
-
Thanks for the responses, I'll try that now. I suspect you are probably right, I thought maybe that was it but I am green enough I trusted the manual. Look at the manual page (http://i31.tinypic.com/ba4l.jpg), that's what it showed. However I am only in the first chapter and have already found 2 typos on my own! This will make 3 typos in just the 1st chapter so far!
I'll report back in a minute or so.
-
I'd suggest moving that manual to trash.
2nd edition of K&R (http://en.wikipedia.org/wiki/The_C_Programming_Language_(book)) would be much more useful.
-
Yup that did it, confirms another F-up in the manual. I may give up on this Super C manual now and just read a generic gcc book I have... :-x
Thanks for the info.
-
Piru wrote:
I'd suggest moving that manual to trash.
2nd edition of K&R (http://en.wikipedia.org/wiki/The_C_Programming_Language_(book)) would be much more useful.
Yeah, I am thinking that would be a good idea. I haven't found this manual to be all that easy to read so far and errors like this make it near impossible to learn. I have THIS (http://www.amazon.com/C-Programming-Easy-Steps/dp/1840783230/ref=sr_1_1?ie=UTF8&s=books&qid=1203816866&sr=8-1) book on hand which I will try next. I may get the actual K&R book too if people like you think it would be beneficial.
-
It's a bit hard for me to judge if it would be beneficial. Learning to program is harder for some, and different learning methods work better for some people than others. If I remember it correctly my very first C tinkering happened without much programming manuals at all (I had some autodocs and examples from RKRM IIRC which I played with).
K&R, however, is the very "C bible" if anything is.
-
@redrumloa
This (http://www.amazon.com/Programming-C-3rd-Developers-Library/dp/0672326663/ref=pd_bbs_1?ie=UTF8&s=books&qid=1203819922&sr=1-1) is another really decent book. I recently bought it to re-learn C so I could start programming on the Amiga. It's very accurate and very clear.
tiffers
-
One of the nice things about the K&R book is the description of the standard library. C language principles are built upon by creating basic implementations of many of the standard library functions, which provides a bit of insight into how and why a standard library exists. There are also simple examples of many basic data structures and algorithms and an appendix that includes the first ANSI standard.
-
2nd edition of K&R (http://en.wikipedia.org/wiki/The_C_Programming_Language_(book)) would be much more useful.
I hardly think the manual is easy for a new programmer. It might be the be all and end all of C references/manuals, but it can be complicated for the beginner.
It's also expensive ;-) I recommend this book, but I think you may well find a better one to "learn from" initially.
-
C on the C64/128 is a waste of time. If you want results, you end up having to rewrite code in Assembly langauge anyway. :-(
-
SamuraiCrow wrote:
C on the C64/128 is a waste of time. If you want results, you end up having to rewrite code in Assembly langauge anyway. :-(
Waste of time, why? Look at my sig. 16bit 20Mhz CPU, 16MB RAM directly addressable to the CPU. Plenty of horsepower untapped, plenty of open source tools that could be ported.
Also what I learn can be used elsewhere. I am currently learning using gcc on Ubuntu.
-
SamuraiCrow wrote:
C on the C64/128 is a waste of time. If you want results, you end up having to rewrite code in Assembly langauge anyway. :-(
What a strange comment. If by "results" you mean hand optimized assembly code, then yes. If, on the other hand, you mean something more along the lines of port pre-existing blocks of codes and routines already written in C to your chosen platform then we end up with a very different metric to judge C by.
C is a very good compromise between small relatively quick code and human read/write-ibility for small platforms.
-
I'd find a good 65816 simulator. There's bound to be a package out there somewhere, probably not for free, that combines a C compiler (with standard library), assembler, and simulator. Something like the stuff available at http://www.avocetsystems.com/company/search/search.php?chip=65816 (http://www.avocetsystems.com/company/search/search.php?chip=65816).
I don't believe a 65816 target exists in the latest gcc, so a Linux solution, let alone an open solution, probably isn't an option. Maybe some Apple IIgs (?) folks would have a few pointers.