1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

GCC Error using Terminal

Discussion in 'Mac Programming' started by suphi, May 17, 2012.

  1. macrumors newbie

    #1
    Hi,

    I have a similar problem i think. Can anyone help me please?
    I am using Xcode Version 4.3.2

    I just tried to compile with gcc command my backgammon game on terminal. Here is the error message:

    Undefined symbols for architecture x86_64:
    "_InitBoard", referenced from:
    _main in ccN5bK2w.o
    "_DrawBoard", referenced from:
    _main in ccN5bK2w.o
    "_decideWhoStarts", referenced from:
    _main in ccN5bK2w.o
    "_RollDices", referenced from:
    _main in ccN5bK2w.o
    "_combinationOfPlayableSquaresWithDices", referenced from:
    _main in ccN5bK2w.o
    "_makeMove", referenced from:
    _main in ccN5bK2w.o
    "_isThereAnyWinner", referenced from:
    _main in ccN5bK2w.o
    ld: symbol(s) not found for architecture x86_64
    collect2: ld returned 1 exit status
     
  2. macrumors 603

    #2
    Post the exact Terminal command you used to compile your program.

    Also, identify the exact .c files that make up your program. For example if there's a "main.c" and a "back.c", then say that. If there's only one .c file, say that.
     
  3. macrumors newbie

    #3
    command: gcc main.c -o back
    And i have 4 .c files. main.c, ai.c, play.c, debut.c.


    Ah ok That was the problem. Thank u for remembering that.
    it works with: gcc main.c ai.c play.c debut.c -o back
     

Share This Page