Never worked with Solaris much in C, but I have in Linux.

Make sure that all the stuff in mysql/libs/mysql is somewhere in your
library path (on linux you have to either copy the files to a new
location or edit /etc/ld.so.conf and rereun ldconfig), and that your
include files are in /usr/include/mysql (symlink 'em) and you can do this:

#include <mysql/mysql.h>

that should be sufficient.  when you do your compiles, make sure you
include -lmysqlclient like so:

gcc -o myprogram myprogram -c -L/usr/local/mysql/lib/mysql -lmysqlclient

---
[EMAIL PROTECTED]


On Thu, 14 Jan 1999, Michael A. Smith wrote:

> I've used MySQL extensively with PHP on Solaris and Linux. Now I'm trying
> to write a simple C app using the MySQL C API to insert data from a file
> into a database. I'm stuck right at the beginning.
> 
> I've done simple C programming, but have never had to link to any
> third-party libraries or headers. I'm working on in Solaris 2.6. I
> installed the MySQL binary distribution. /usr/local/mysql/lib and
> /usr/local/mysql/include are in my PATH.
> 
> What should I put at the top of my source code to access the MySQL C API?
> 
> Thanks for you patience!
> 
> ****************
> Michael A. Smith | [EMAIL PROTECTED]
> Site Development Engineer | digitalNATION | http://www.dn.net
> ****************
> "The programmer, like the poet, works only slightly removed from pure
> thought-stuff. He builds his castles in the air, from air, creating by
> exertion of the imagination. Few media of creation are so flexible, so easy
> to polish and rework, so readily capable of realizing grand conceptual
> structures."
>                                     --Frederick P. Brooks, Jr
>                                       The Mythical Man-Month
> ****************
> -----------------------------------------------------------
> Send a mail to [EMAIL PROTECTED] with
> unsubscribe mysql [EMAIL PROTECTED]
> in the body of the message to unsubscribe from this list.
> 

-----------------------------------------------------------
Send a mail to [EMAIL PROTECTED] with
unsubscribe mysql [EMAIL PROTECTED]
in the body of the message to unsubscribe from this list.

Reply via email to