shanenin Posted August 28, 2005 Report Share Posted August 28, 2005 I seem to be following my book exactly, but am getting numerous errors when compilinghere is the code/* this my first c program*/#include <stdio.h>main(){ putchar(65); putchar(10); putchar(66); putchar(10); putchar(67); putchar(10); reuturn 0;}I am using this to compile itshane@mainbox shane $ gcc test.c -o testctest.c: In function `main':test.c:13: error: `reuturn' undeclared (first use in this function)test.c:13: error: (Each undeclared identifier is reported only oncetest.c:13: error: for each function it appears in.)test.c:13: error: syntax error before numeric constant Quote Link to post Share on other sites
d_leet Posted August 28, 2005 Report Share Posted August 28, 2005 (edited) Well you spelled return wrong, I'm just starting to learn C so that's all I can help with though, but fix that and try running it.Yea I just tested it with return fixed and it runs fine. Edited August 28, 2005 by d_leet Quote Link to post Share on other sites
shanenin Posted August 28, 2005 Author Report Share Posted August 28, 2005 (edited) thanks that was the problem. I thought that I erased this post, noticing my dumb error, espesially with this line test.c:13: error: `reuturn' undeclared (first use in this function)I should not have even had to ask what was wrong.edit added later//part of me not noticing the obvious error was I was looking to close at these errorstest.c:13: error: (Each undeclared identifier is reported only oncetest.c:13: error: for each function it appears in.)test.c:13: error: syntax error before numeric constantI assumbed I had all kinds of things screwed up Edited August 28, 2005 by shanenin Quote Link to post Share on other sites
jcl Posted August 28, 2005 Report Share Posted August 28, 2005 (edited) GCC has the least useful diagnostics I've ever seen in a piece of software. And I'm including ed. g++ is almost malicious.BTW, -ansi -W -Wall are your friends. Edited August 28, 2005 by jcl Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.