I am trying to create a game and tried compiling my program with my makefile, but I keep getting an error stating that there is something wrong in main. I can't seem to find the error, but this is how my main looks like:

#include "tfdef.h"
#include "movement.h"
#include "game_utils.h"
#include "display.h"
#include "menus.h"
#include "mine.h"
#include <stdio.h>

int main()
{
  int difficulty, want_play, games, points, win;
  points = games = win = 0;

  /* Intro */
  want_play = text_intro();

  /* While user wants to play */
  while(want_play)
    {
      /* Difficulty */
      difficulty = diffselect();

      /* Play the game and sum up total points*/
      points += mine_game(difficulty, &win);

      /* Ask play again */
      want_play = retry_game();

      /* Increment rounds */
      games++;
    }

  printf("You played %d games", games);
  printf(" and scored %d points\n", points);
  printf("Wins: %d   Loses: %d\n", win, games - win);
  printf("Win per game ratio is %.2f\n\n", (float)win / games);
}

and this is how my makefile looks like

# define some macros
CFLAGS = -Aa -g

# finished game
miensfeld: main.o mine.o menus.o movement.o game_utils.o display.o
        cc main.o mine.o menus.o movement.o game_utils.o display.o -o miensfeld -lcurses

# dependancies
main.o: tfdef.h movement.h game_utils.h menus.h mine.h display.h

mine.o: tfdef.h game_utils.h movement.h mine.h display.h

display.o: datatype.h display.h

displaytest.o: datatype.h display.h

menus.o: menus.h tfdef.h

game_utils.o: game_utils.h

mine.o: game_utils.h tfdef.h movement.h display.h

intro.o: menus.h

movement.o: game_utils.h movement.h tfdef.h mine.h display.h

links:
        ln -s ../display.o .
        ln -s ../display.h .
        ln -s ../move .
        ln -s ../points .
        ln -s ../title1 .
        ln -s ../movements .
        ln -s ../flags .
        ln -s ../glif .
clean:
        mv display.o display.sav
        rm -f *.o
        mv display.sav display.o

real_clean: clean
        rm  -f miensfeld a.out core

This is the error I get when putting "make miensfeld":
cc -Aa -g -c -o main.o main.c
<command-line>: error: missing '(' after predicate
make: *** [main.o] Error 1

Does anyone see the error?

This is the error I get when putting "make miensfeld":
cc -Aa -g -c -o main.o main.c
<command-line>: error: missing '(' after predicate
make: *** [main.o] Error 1

Does anyone see the error?

No but since you left out most of the relevant information from the compiler error that is hardly surprising.

That error message contained the file name and line number when the compiler output it but you have seen fit to leave them out of your post. The error may not even be in main.c it could easily be, and probably is in my opinion, in another file included into main.c.

Next time I suggest you post the entire error message without editing it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.