Re: [code][gurus][mysql]

From: George (
Date: 01/10/99

On Sat, 9 Jan 1999, Invincibill wrote:

>the math lib and the mysqlclient lib. using -lm -lmysqlclient
>my question is, in the makefile, is there some easy way to set it up so
>that if the mysql.h is in the object dependencies, it automatically adds
>the -lm and -lmysqlclient? or is there someway to build it so i dont
>need to link them? i'm really clueless when it comes to linking
>libraries and whatnot.(among a good many other things)  i have my
>libraries in my /lib directory and the mysql.h is in the /include

Sounds like you need Makefile tricks

$ make MYSQL=y

-- Makefile --

ifeq ($(MYSQL),y)
  LIBS += -lm -lmysqlclient

-- (files).c --

#ifdef USE_MYSQL
#include <mysql.h>

George Greer

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  |

This archive was generated by hypermail 2b30 : 12/15/00 PST