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).

Thanks.
Andrew




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

Reply via email to