Hi Mateusz,
A better way is to use the make file generated by Dev-C++. When you create a
new project using Dev-C++ and compile it, a make file named makefile.win is
created. The Dev-C++ IDE then invokes make.exe on this makefile.win to
compile and link your project into an exe file.
Another way to make the project is to use the command line:
make -f makefile.win.
(This assumes that the compiler's bin directory is in the system path.)
Here's an example makefile.win that builds a simple Windows GUI application.
<begin>
# Project: MySQLPrj1
# Makefile created by Dev-C++ 4.9.2.0
CC = gcc.exe
WINDRES = windres.exe
OBJ = file.o
LIBS = -L"D:\DEV-C++5BETA\lib"
INCS = -I"D:\DEV-C++5BETA\include"
BIN = mysqlprj1.exe
CFLAGS = $(INCS) -s -O3 -mwindows
.PHONY: clean
all: mysqlprj1.exe
clean:
rm -f $(OBJ) $(BIN)
mysqlprj1.exe: $(OBJ)
$(CC) $(OBJ) -o $(BIN) $(RES) $(LIBS) $(CFLAGS)
file.o: file.c
$(CC) -c file.c -o file.o $(CFLAGS)
<end>
To compile and link with MySQL headers and libs, you should add the header
and lib files + paths to the LIBS and INCS.
The use of make files is recommended for multi-file projects. However, you
can also use it for single source code file projects.
Regards,
Yeoh
~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~
Author of "How to Create an eBook Using Visual C++"
Free Downloads at http://www.yeohhs.com
ICT eBooks by Yeoh HS
~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~
----- Original Message -----
From: Mateusz Podbielski <mpo...@us...>
To: <dev...@li...>
Sent: Tuesday, May 07, 2002 1:52 AM
Subject: [Dev-C++] MySQL libraries
> Hi guys.
>
> I think that it's a simple question but how can I include required
> libraries? I've to include them to make connection with MySQL
> server. Is it good to use: gcc -L -l<library> file.c ?
>
>
> Regards,
>
> Matt
>
|