Re: Compile & MySql questions



Let me help you out with #1.

First of all, if you're going to be calling one function from another file,
you're going to need a global file that will contain your function
declarations (like a global.h file).  Once you've created that and included
it in each of the .c files, you'll be good to go - you'll need to create a
Makefile that calls out the proper method for the compile.
-------------------Makefile example---------
DEBUG  = -g
EXEC  = main_prg
CC  = /usr/bin/gcc

C_FLAGS = -Wall -O $(DEBUG)
L_FLAGS = -Wall -O $(DEBUG)
O_FILES = my_funcs1.o my_funcs2.o main_prg.o

main_prg: $(O_FILES)
        $(CC) $(L_FLAGS) -o $(EXEC) $(O_FILES)

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

This Makefile assumes you have a global.h, my_funcs1.c, my_funcs2.c and a
main_prg.c
The compile command includes the list $(O_FILES) of .o files which it makes
first.  It will recompile the .o files from whatever .c files have changed,
and then compile all the .o files together into one nice binary named
main_prg.

global.h contains the declarations for each function that will be used that
is contained in a different file..
e.g.
void my_func(int my_passed_variable);
and each file would contain
#include global.h
---------------
As for #2 - dunno - thats why I joined this list :)


----- Original Message -----
From: "Pablo Fischer" <exilion yifan net>
To: <gtk-app-devel-list gnome org>
Sent: Thursday, July 18, 2002 9:40 PM
Subject: Compile & MySql questions


Hello All;

First..

1) My software have a lot lot of functions.. so I want to divide those
functions in separate *.c files (add.c, search.c, configuration.c), so..
How can I compile ALL my GTk application, when some functions are in
other files?. like a multi-compilation-software, heh.

2) Somebody knows of a tutorial of gtk-mysql functions? I know SQL.. but
I want to use it with my GTK application (yeah.. I know that php-gtk
exists.. but I want a binary application). Where can I find mysql.h to
take the functions?.

Thanks;
Paul Fischer







_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]