View Full Version : mysql.h where
progmat
salamo 3alekom
i successfully run mysql on my computer
and trying some query and at last successfully run :)
but when i move to the next step in mysql programming
i couldn't find mysql.h header file which needed to create a mysql C/C++ program
i search for it all over my linux and search return 0
the expected solutions are :-
mysql-devel not installed but sadly i had it installed
try reinstall mysql no thing new happen
can i get help?????? :confused: :confused:
uniball
libmysql-devel ?
find / -name mysql.h
progmat
salamo 3alekom
whatttttttt do u mean ??????
sattia
it is better to post the error msg u get and the steps uve done
progmat
salmo 3alekom
thanks a lot for reply
ok my error message is
no such file
i just try to included it in a c program
i want to remeber all of u
it run correctly but on my machine
and the problem that i can't ind the mysql.h to create a c/c++ interface to it
Regards
progmat
salmo 3alekom
at last i did it
here is the soluttion and another question
i downloaded an rpm called
mysql-devel-3.23.54a-11.i386.rpm
when i install it no thing happen
but when a look at
/usr/src/redhat/SOURCES
..../SPECS
i find the sources in *.tat.gz
in specs file for that package
which i use it to create a binary package
rpmbuild -ba .......
at and install it
then i find mysql.h files
now the question is
is redhat 9.0 mysql-devel doesn't have that file or there's another problem ????
and how can i create the rpm which included the sources like that one before ???????
RedHat
Progmat,
I am not sure what are you doing but mysql-devel RPM is the RPM you need in order to do any development for mysql. As the nams indicates it should have the DEVELOPMENT necessary files, one of them is mysql.h which is the one you are looking for.
- The Latested updated RPM from Red Hat is:
RPM: mysql-devel-3.23.56-1.9.i386.rpm
The RPM has the file you are looking for, you can verify that by "rpm -qfp mysql-devel-3.23.56-1.9.i386.rpm"
The file information is :
File: /usr/include/mysql/mysql.h
MD5 Sum: ba1670b5a7ed42217920273d4e4297bb
Last Modified: 2003-04-30 17:31:34
Size: 10,787 bytes
You do not need to download another RPM from another distribution to find this file, you do not need to rebuild anything because it is not missing.
You should find the original RPM on RH9 CD which is:
RPM : mysql-devel-3.23.54a-11.i386.rpm
Hope that is pretty much asnwer your question
alaa
first of all what is you distro ??
and how are you trying to find the file??
in Mandrake the package you need will be something like libmysql12-devel
in Mandrake the way to find the Package which supplies a certain file is through urpmf.
for instance if you do
urpmf mysql.h
you'll get:
.....
....
libmysql12-devel:/usr/include/mysql/mysql.h
----------------
to find a file in your system you use locate or find
locate mysql.h
find / -name mysql.h
locate is faster since it searches a database, but if your database is not uptodate it may fail
find will search through the entire system for the file.
------------------------
you need to use mysql_config when compiling your program this way
gcc foo.c -o foo `mysql_config --cflags --libs`
note that if you'll use mysql_config then you should not use include this way:
#include <mysql/mysql.h>
but rather this way
#include <mysql.h>
cheers,
Alaa
sattia
first of all what is you distro ??
but when a look at
/usr/src/redhat/SOURCES
..../SPECS
I thought that it is obvious to be a Red Hat Linux; isnt it? ;)
alaa
well I did not understand at all why he had source tarballs and spec files after installing a package so I thought he must be doing something wrong.
and it is not uncommon for people to just install the first package they find on the net regardless of whether it is made for their system or not and then complain about crappy GNU/Linux package management :-)
cheers,
Alaa
sattia
Originally posted by progmat
salmo 3alekom
at last i did it
here is the soluttion and another question
i downloaded an rpm called
mysql-devel-3.23.54a-11.i386.rpm
when i install it no thing happen
but when a look at
/usr/src/redhat/SOURCES
..../SPECS
i find the sources in *.tat.gz
in specs file for that package
which i use it to create a binary package
rpmbuild -ba .......
at and install it
then i find mysql.h files
now the question is
is redhat 9.0 mysql-devel doesn't have that file or there's another problem ????
and how can i create the rpm which included the sources like that one before ???????
Im sorry to say that but it seems that u mistaken and instead of installing a binary rpm package ur just installed a src rpm package. btw src rpms mostly need to be recompiled or rebuilt not installed (rpmbuild --rebuild mysql-devel......)
make sure that the mysql-devel-.... ends in .i386.rpm and not src.rpm
progmat
salamo 3alekom
i want first to thank all of u to ur replys
fisrt my distro is as sattia expected
is redhat 9 as i refered
mr RedHat
as i said before if i have already install
mysql-devel .........
which i found in my redhat9 cd 2 but also i couldn't find mysql headers files
and then removed them and reinstall them and nothing changed
which enforce me to download that file
then is there a problem in my distro or
i need update ?????????
mr alaa
sattia shot it agian and reply on u that i install src rpm package not a binary backage and when i try rpm -ih .......
no thing happen but when i find a number of new *.tar.gz and a new spec files i recompile them using spec files to a binary rpm
rombuilt -ba .... .spec
and install it
wednak meneen ya go7a
and at last i got mysql headers file
in the place u refer
/usr/includes/mysql
/usr/libs/mysql
mr sattia
thanks a lot for ur notes on the different between src.rpm package and rpm binary backage but i think src rpm package is better because it ust about 500 kb and when i convert it to rpm binary package it reaches 3 MB
the package name is
mysql-devel-3.23.54a-11.i386.rpm :confused:
after compiling it become
mysql++-1.7.9-4.rh9.i386.rpm
Ok at last i could change a database through a c program after three days of trials :D
Regards to all
vBulletin v3.0.1, Copyright ©2000-2004, Jelsoft Enterprises Ltd.