Compiling Anagramarama

This is a discussion on Compiling Anagramarama within the C Programming forums, part of the General Programming Boards category; I don't know much about programming in C--I've written a few pretty basic programs for a college course, but nothing ...

  1. #1
    Registered User
    Join Date
    Jan 2007
    Posts
    2

    Compiling Anagramarama

    I don't know much about programming in C--I've written a few pretty basic programs for a college course, but nothing intense. I wanted to tinker around with Anagramarama, a free (GPL'd) game, so I downloaded the source code from http://www.coralquest.com/anagramarama/download.html and I tried to compile it with gcc (I'm running Ubuntu Edgy) and got a bunch of errors. I've never compiled programs from multiple files, so I was just wondering if anybody could tell me what I'm doing wrong. Here's an example of me trying (and failing miserably) to compile it:

    austin@austin-laptop:~/downloads/anagramarama/src$ ls
    ag.c ag.h dlb.c linked.c sprite.c sprite.h
    ag.c~ cvs dlb.h linked.h sprite.c~ sprite.h~
    austin@austin-laptop:~/downloads/anagramarama/src$ gcc -o anagramarama ag.c dlb.c linked.c sprite.c
    ag.c:61:21: error: SDL/SDL.h: No such file or directory
    ag.c:62:27: error: SDL/SDL_mixer.h: No such file or directory
    In file included from ag.c:67:
    sprite.h:33: error: expected specifier-qualifier-list before ‘SDL_Surface’
    sprite.h:43: error: expected ‘)’ before ‘*’ token
    sprite.h:44: error: expected ‘)’ before ‘*’ token
    sprite.h:45: error: expected ‘)’ before ‘*’ token
    sprite.h:46: error: expected ‘)’ before ‘*’ token
    sprite.h:47: error: expected ‘)’ before ‘*’ token
    ag.c:100: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token

    and the errors go on for about twice as long, but I figured that this is a fair example of what's going on. That first error message looks like it's not finding some .h files, right? Do I need to download those from somewhere or just fix my PATH variable or what? Any help would be greatly appreciated. Thanks!

    Austin

  2. #2
    Registered User
    Join Date
    Sep 2001
    Posts
    752
    SDL is a programming interface for games which this program apparently uses. Make sure you've installed the SDL package through package manager.

    The make utility is generally what you want to use for something like this.
    Code:
    questionc@mercury ~/anagramarama
    $ make
    This will read the makefile and compile according to the rules in there.

    If you want to manually compile, here's the command line:
    Code:
    gcc -Wall `sdl-config --cflags --libs` -funroll-loops -fomit-frame-pointer -pipe -O9 -lSDL_mixer-o anagramarama ag.c dlb.c linked.c sprite.c
    A lot of those options are probably not strictly neccesary.
    Callou collei we'll code the way
    Of prime numbers and pings!

  3. #3
    Registered User
    Join Date
    Jan 2007
    Posts
    2

    Working now

    Ah yes, the make command is a big help. Also, I thought I had the SDL files, but apparently not. Found them pretty easily, and now its all good. Thanks!

    Austin

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Newbie Compiling Problem
    By Deronius in forum C++ Programming
    Replies: 3
    Last Post: 06-15-2008, 11:23 AM
  2. Problem compiling files that store functions
    By tiachopvutru in forum C++ Programming
    Replies: 10
    Last Post: 05-30-2008, 05:42 PM
  3. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  4. Compiling
    By Dae in forum C++ Programming
    Replies: 7
    Last Post: 06-15-2005, 01:08 AM
  5. compiling and executing issue with lcc win32
    By GanglyLamb in forum C Programming
    Replies: 10
    Last Post: 12-22-2004, 01:24 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21