Author Topic: First code problems  (Read 3773 times)

stocky

  • Guest
First code problems
« on: July 23, 2016, 10:52:01 am »
 Hi Sorry for asking for help but Im a complete newbie and just want to get on the road with C using an absolute beginners guide.

Ive tried the first code they have suggested in code blocks and its having problems...

#include <stdio.h>
main()
{
    print("Just one small steop for coders.  One giant leap for") ;
    printf(" programmers!\n") ;
    return 0;
}


build log -

-------------- Build: Debug in Beginnings (compiler: GNU GCC Compiler)---------------

g++  -o bin/Debug/Beginnings obj/Debug/main.o   
Undefined symbols for architecture x86_64:
  "_print", referenced from:
      _main in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Any help anyone could give would be much appreciated.  Apologies again but I really want to start learning as soon as possible so if anyone can help with simple explanations I would really appreciate it!!

Thank you Alan

Offline raynebc

  • Almost regular
  • **
  • Posts: 223
Re: First code problems
« Reply #1 on: July 23, 2016, 11:01:14 am »
The first function call in main() has a typo.  It is "printf", not "print".  The "undefined symbol" error given means there's no such function defined.  Otherwise just know that this isn't a forum for troubleshooting general programming problems.