p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Linux (http://p2p.wrox.com/forumdisplay.php?f=54)
-   -   Connecting to MYSQL from C / C++ ? (http://p2p.wrox.com/showthread.php?t=50334)

oloeriubogdan November 15th, 2006 04:47 PM

Connecting to MYSQL from C / C++ ?
I’ve just installed fedora 6.
In my free time I’m trying to work on a project as much as possible. What I want too do is to connect to MySql from C.

I’ve read the MYSQL chapter from Beginning Linux Programming – 3rd edition but it seams that I can’t connect to the mysql from C because I do not have the “mysql.h” library on my system.
The mysql shell utility is working just fin and the actual chapter form the book is not saying anything about what to do in this case.

connect1.c contains the code that I’m trying to compile

#include <stdlib.h>
#include <stdio.h>
#inlcude “mysql.h”

int main (void)
    return 0

The compile commands that the book say that shod work in most of the cases are:

$ gcc -I/usr/include/mysql connect1.c -L/usr/lib/mysql -lmysqlclient -lz -o connect1


$ gcc -I/usr/include/mysql connect1.c -lmysqlclient -o connect1
The problem is that it was impossible for me too find in my hole directory structure a file cooled mysql.h.

A big inconvenient is that I’m using a dialup connection. The internal modem that I use is a winmodem so “No Linux drivers”. All that I can do is just download from windows the files and then copy them too fedora.

Please do help me.


crmpicco December 15th, 2006 10:50 AM



All times are GMT -4. The time now is 09:38 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.