Quantcast
Channel: openSUSE Forums
Viewing all articles
Browse latest Browse all 40713

can't connect a mysql databse from a c programm

$
0
0
Hi there,

I'm trying to connect a mysql database from a c program.
Program begin like this:

Code:

#include <stdio.h>
#include <stdlib.h>
#include <mysql.h>

void main(void){

When I compile:

Code:

cc -c myprogram.c
This error is displayed:

Code:

q.c:3:10: fatal error: mysql.h: No such file or directory
 #include <mysql.h>
          ^~~~~~~~~

I had try to install (that actually I don't know if has someting to do whit this)

libmysqlclient-dev

Here is all code :

Code:

brownie:~ # apt-get install libmysqlclient-dev
Loading repository data...
Reading installed packages...
'libmysqlclient-devel' not found in package names. Trying capabilities.
'libmariadb-devel' providing 'libmysqlclient-devel' is already installed.
Resolving package dependencies...


Now, I'm totally lost. I really don't know what do I have to do to connect my program with a mysql database

Any help will be very appreciated !
Thanks in advance for any feedback

Regards

Agunet74

Viewing all articles
Browse latest Browse all 40713

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>