At 6:32 -0400 6/26/03, Andrew Pierce wrote:
I have a question regarding compiling a C program with the mysql C api.
From the documentation, the only way I really see explained for compiling
is a shell script that looks like this:

CFG=/usr/bin/mysql_config
sh -c "gcc -o $1 `$CFG --cflags` $1.c `$CFG --libs`"

This works great when all my source code is in one file. However, I need
to modularize things and do separate compile and link steps. When I do
this,

sh -c "gcc -o $1 `$CFG --cflags` $1.c"

It complains that it cannot find the header file for mysql.h. This does
not make sense to me. Also, I do not understand why I need to do the sh
-c. Why can I not just do the gcc part here?

I really want to build a makefile but I am just trying to take baby steps
here (I am new to Linux programming).

Go to:


http://www.kitebird.com/mysql-book/

Grab the PDF of Chapter 6 and read pp 321 - 324.  That may help
you.

Thanks.
Andrew


--
Paul DuBois, Senior Technical Writer
Madison, Wisconsin, USA
MySQL AB, www.mysql.com

Are you MySQL certified? http://www.mysql.com/certification/


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to