Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Open Source > Linux
| Search | Today's Posts | Mark Forums Read
Linux General discussion of programming the various flavors of Linux operating systems.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Linux section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 15th, 2006, 04:47 PM
Registered User
 
Join Date: Nov 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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
Code:
#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:
Code:
$ gcc -I/usr/include/mysql connect1.c -L/usr/lib/mysql -lmysqlclient -lz -o connect1

ore
Code:
$ 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.


 
Old December 15th, 2006, 10:50 AM
Friend of Wrox
Points: 8,019, Level: 38
Points: 8,019, Level: 38 Points: 8,019, Level: 38 Points: 8,019, Level: 38
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default

http://www.ucl.ac.uk/is/mysql/c/

www.crmpicco.co.uk
www.ie7.com




Similar Threads
Thread Thread Starter Forum Replies Last Post
Connecting mysql to php?? Manu Sharma BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 3 March 5th, 2007 01:40 AM
Connecting To MySQL from PHP AlisP2P MySQL 1 January 4th, 2006 02:27 AM
Connecting to mySQL WIx ASP.NET 1.0 and 1.1 Basics 3 October 17th, 2004 04:13 PM
connecting to mysql using Php webmoron BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 6 August 24th, 2004 04:30 AM
connecting mysql with vb ks_anoop MySQL 3 February 5th, 2004 02:43 PM





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