12 Mar, 2011, govtcheeze wrote in the 1st comment:
Votes: 0
I recently cracked open my old mud code and one project I want to do is add mysql. I figured I would start with stock rom to get it working first and then port into my code. I am able to compile a test file to just check mysql with the following and it reads/writes from the db as expected:

gcc file.c -o file.exe `mysql_config –cflags –libs`


I added the code to stock rom but cannot figure out how to get the makefile to work right. The compile either gives an error:

db.c:34:19: fatal error: mysql.h No such file or directory


or I get this error:

gcc -c -Wall -O -g  -I /usr/include/mysql db.c
In file included from db.c:45:0:
merc.h:110:45: error: expected identifier or ( before ) token


I think its just my makefile not set up correctly. I have searched google and this forum and tried the various examples I found but nothing seems to work. Ideas?

Here is the stock rom makefile:

CC      = gcc
PROF = -O -g
NOCRYPT =
C_FLAGS = -Wall $(PROF) $(NOCRYPT)
L_FLAGS = $(PROF)
LIBS = -lcrypt

O_FILES = act_comm.o act_enter.o act_info.o act_move.o act_obj.o act_wiz.o \
alias.o ban.o comm.o const.o db.o db2.o effects.o fight.o flags.o \
handler.o healer.o interp.o note.o lookup.o magic.o magic2.o \
music.o recycle.o save.o scan.o skills.o special.o tables.o \
update.o

rom: $(O_FILES)
rm -f rom
$(CC) $(L_FLAGS) -o rom $(O_FILES) $(LIBS)

.c.o: merc.h
$(CC) -c $(C_FLAGS) $<


I posted some additional details / attempts here:

http://www.drow.org/forums/showthread.ph...

Thanks in advance.
13 Mar, 2011, plamzi wrote in the 2nd comment:
Votes: 0
Here's what I have in my (circle-based) Makefile. Hope it helps.

LIBS = -I/usr/include/mysql  -DBIG_JOINS=1  -fno-strict-aliasing -DUNIV_LINUX -DUNIV_LINUX -Wl,-Bsymbolic-functions -rdynamic -L/usr/lib/mysql -lmysqlclient 



gcc -o bin/circle $(PROFILE) $(OBJFILES) $(LIBS) $(mysql_config –cflags) $(mysql_config –libs)
07 Feb, 2012, govtcheeze wrote in the 3rd comment:
Votes: 0
yum install mysql-devel



No idea how I missed this before, and thanks for the circle makefile. That helped me get it running once the dev library was installed.
0.0/3