Sign in with
Sign up | Sign in
Your question

cant compile pmars 0.9.5-2 on os x

Last response: in Video Games
Share
Anonymous
August 28, 2005 12:54:13 PM

Archived from groups: rec.games.corewar (More info?)

(01:42 Shodan:o llie)
src/$ cat Makefile && make

*****************MAKE FILE*************************

# generic UNIX makefile
CC = gcc-3.3 # req. for linux
#CC = cc # if you don't have gcc
# Configuration options:
#
# No. Name Incompatible with Description
# (1) -DSERVER 2 disables cdb debugger (koth
server
# version)
# (2) -DGRAPHX 1 enables platform specific
core
# graphics
# (3) -DKEYPRESS only for curses display on
SysV:
# enter cdb upon keypress
(use if
# Ctrl-C doesn't work)
# (4) -DEXT94 ICWS'94 + SEQ,SNE,NOP,*,{,}
# (5) -DSMALLMEM 16-bit addresses, less
memory
# (6) -DXWINGRAPHX 1 X-Windows graphics (UNIX)
# (7) -DPERMUTATE enables -P switch
# (8) -DSDLGRAPHX 1 SDL graphics (generic)

#DBG = -g -W -Wall -pg
CFLAGS = -O -DEXT94 -DXWINGRAPHX -L/usr/X11R6/include -DPERMUTATE
LFLAGS = -x
# LIB = -lcurses -ltermlib # enable this one for curses
display
# LIB = -lvgagl -lvga # enable this one for
Linux/SVGA
LIB = -L/usr/X11R6/lib -L/usr/X11R6/include/X11 #
enable this one for X11
# INC = `sdl-config --cflags` # enable this one for SDL
graphics
# LIB = `sdl-config --libs` # enable this one for SDL
graphics

EXESUFFIX=
..SUFFIXES: .o .c .c~ .man .doc .6
MAINFILE = pmars$(EXESUFFIX)

HEADER = global.h config.h asm.h sim.h
OBJ1 = pmars.o asm.o eval.o disasm.o cdb.o sim.o pos.o
OBJ2 = clparse.o global.o token.o
OBJ3 = str_eng.o

all: flags $(MAINFILE)

flags:
@echo Making $(MAINFILE) with compiler flags $(CFLAGS)

$(MAINFILE): $(OBJ1) $(OBJ2) $(OBJ3)
@echo Linking $(MAINFILE)
@$(CC) $(CFLAGS) -o $(MAINFILE) $(OBJ1) $(OBJ2) $(OBJ3) $(LIB)
@strip $(MAINFILE)
@echo done

token.o asm.o disasm.o: asm.h

sim.o cdb.o pos.o disasm.o: sim.h

sim.o: curdisp.c uidisp.c sdldisp.c lnxdisp.c xwindisp.c

xwindisp.c: xwindisp.h pmarsicn.h

lnxdisp.c: lnxdisp.h

$(OBJ1) $(OBJ2) $(OBJ3): Makefile config.h global.h

..c.o:
@echo Compiling $*.o
@$(CC) $(CFLAGS) -c $*.c

clean:
rm -f $(OBJ1) $(OBJ2) $(OBJ3) core


***************MAKE*************************
Making pmars with compiler flags -O -DEXT94 -DXWINGRAPHX
-L/usr/X11R6/include -DPERMUTATE
Compiling pmars.o
Compiling asm.o
Compiling eval.o
Compiling disasm.o
Compiling cdb.o
Compiling sim.o
Compiling pos.o
Compiling clparse.o
Compiling global.o
Compiling token.o
Compiling str_eng.o
Linking pmars
ld: Undefined symbols:
_XAllocClassHint
_XAllocColor
_XAllocSizeHints
_XAllocWMHints
_XChangeWindowAttributes
_XCheckMaskEvent
_XClearWindow
_XCloseDisplay
_XCopyArea
_XCopyColormapAndFree
_XCreateBitmapFromData
_XCreateFontCursor
_XCreateGC
_XCreatePixmap
_XCreateSimpleWindow
_XDefineCursor
_XDisplayName
_XDrawLine
_XDrawPoint
_XDrawRectangle
_XDrawString
_XFillRectangle
_XFreePixmap
_XLoadQueryFont
_XLookupString
_XMapWindow
_XMatchVisualInfo
_XNextEvent
_XOpenDisplay
_XParseColor
_XResizeWindow
_XSelectInput
_XSetBackground
_XSetFont
_XSetForeground
_XSetLineAttributes
_XSetWMProperties
_XSetWindowColormap
_XStringListToTextProperty
_XWarpPointer
_sighandler
make: *** [pmars] Error 1
(01:43 Shodan:o llie)
src/$


help. why cant i compile (i thought it was a problem with having
xfree86 libs (or lack of) but i've installed them now (probably
incorrectly...) but it still refuses to compile.

if you dont know what pmars is, its a corewars simulator. corewars is a
game where you write your own 'warriors' in pseudo assembler and then
pit them in battle for king of the hill. much fun. i was using the
corewars package avaliable via fink (fink install corewars) but that
seems to have issues with some perfectly valid code. and pmars is the
official thing... however, it doesnt want to run (i want X. i did
manage to compile it as a server without issues.)

when i installed the xfree86-shlibs package it bitched at me about not
wanting to install till i removed the old ones. so i just moved them to
another dir (probably not the best idea, frustrated.) but yeah, doesnt
want to compile.

i'm probably just missing a -L/usr/something/somethingelse in the make
file.


anyone??

passes out.

More about : compile pmars

Anonymous
August 28, 2005 7:03:10 PM

Archived from groups: rec.games.corewar (More info?)

sorry about the retarded bit at the end, talking about what corewars
is. I was trying to post this to some forums but they were giving me
greif so i posted it here but forgot to edit it.
Anonymous
August 30, 2005 2:04:44 AM

Archived from groups: rec.games.corewar (More info?)

fixed

my make file is now :

# generic UNIX makefile
CC = gcc-3.3 # req. for linux
#CC = cc # if you don't have gcc
# Configuration options:
#
# No. Name Incompatible with Description
# (1) -DSERVER 2 disables cdb debugger (koth
server
# version)
# (2) -DGRAPHX 1 enables platform specific
core
# graphics
# (3) -DKEYPRESS only for curses display on
SysV:
# enter cdb upon keypress
(use if
# Ctrl-C doesn't work)
# (4) -DEXT94 ICWS'94 + SEQ,SNE,NOP,*,{,}
# (5) -DSMALLMEM 16-bit addresses, less
memory
# (6) -DXWINGRAPHX 1 X-Windows graphics (UNIX)
# (7) -DPERMUTATE enables -P switch
# (8) -DSDLGRAPHX 1 SDL graphics (generic)

DBG = -g -W -Wall -pg
CFLAGS = -O -Dunix $(DBG) -L/sw/lib -L/usr/X11R6/lib -lgtk -lgdk
-lgmodule -lglib -lintl -lXext -lX11 -lm -I/sw/include -L/usr/X11R6/lib
-DEXT94 -DXWINGRAPHX -DPERMUTATE $(INC) -I/usr/X11RC/include
-L/Developer/SDKs/MacOSX10.4.0.sdk/usr/X11R6/lib/
LFLAGS = -x
# LIB = -lcurses # enable this one for curses display
LIB = -lvgagl -lvga # enable this one for Linux/SVGA
LIB = -L/usr/X11R6/lib -I/usr/X11RC/include
-L/Developer/SDKs/MacOSX10.4.0.sdk/usr/X11R6/lib/ # enable this one
for X11
# INC = `sdl-config --cflags` # enable this one for SDL graphics
# LIB = `sdl-config --libs` # enable this one for SDL graphics

EXESUFFIX=
..SUFFIXES: .o .c .c~ .man .doc .6
MAINFILE = pmars$(EXESUFFIX)

HEADER = global.h config.h asm.h sim.h
OBJ1 = pmars.o asm.o eval.o disasm.o cdb.o sim.o pos.o
OBJ2 = clparse.o global.o token.o
OBJ3 = str_eng.o

all: flags $(MAINFILE)

flags:
@echo Making $(MAINFILE) with compiler flags $(CFLAGS)

$(MAINFILE): $(OBJ1) $(OBJ2) $(OBJ3)
@echo Linking $(MAINFILE)
@$(CC) $(CFLAGS) -o $(MAINFILE) $(OBJ1) $(OBJ2) $(OBJ3) $(LIB)
@strip $(MAINFILE)
@echo done

token.o asm.o disasm.o: asm.h

sim.o cdb.o pos.o disasm.o: sim.h

sim.o: curdisp.c uidisp.c sdldisp.c lnxdisp.c xwindisp.c

xwindisp.c: xwindisp.h pmarsicn.h

lnxdisp.c: lnxdisp.h

$(OBJ1) $(OBJ2) $(OBJ3): Makefile config.h global.h

..c.o:
@echo Compiling $*.o
@$(CC) $(CFLAGS) -c $*.c

clean:
rm -f $(OBJ1) $(OBJ2) $(OBJ3) core


i got some of the cflags i got from fink, plus -Dunix.

thanks to everyone who helped in #corewars
!