Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
01-27-2010, 10:09 AM
|
#1
|
Member
Registered: Jul 2008
Location: Ghent, Belgium
Distribution: Fedora, CentOS
Posts: 694
Rep:
|
Error when trying to compile cbmysql for web-meetme
The README reads :
Quote:
* Compile and install CBMySQL
App_cbmysql is now included in the web-meetme package,
located in ./cbmysql. To install just run make; make install
|
Code:
bash-3.2# pwd
/var/www/html/cbmysql
bash-3.2# make
cc -shared -Xlinker -x -o app_cbmysql.so app_cbmysql.o -I/usr/include/mysql -L/usr/lib/mysql -lmysqlclient
/usr/bin/ld: skipping incompatible /usr/lib/mysql/libmysqlclient.so when searching for -lmysqlclient
/usr/bin/ld: skipping incompatible /usr/lib/mysql/libmysqlclient.a when searching for -lmysqlclient
/usr/bin/ld: cannot find -lmysqlclient
collect2: ld returned 1 exit status
make: *** [app_cbmysql.so] Error 1
This is on CentOS 5.3, kernel 2.6.18-128.4.1.el5xen.
Can you advise concerning this 'lmysqlclient' ?
|
|
|
01-27-2010, 01:26 PM
|
#2
|
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,520
|
The file lmysqlclient which means libmysqlclient.so
is in the package : mysql-devel .
Probable issues : 1) The package is not installed.
Or 2)
The location is : /usr/lib/mysql/libmysqlclient.so
.. may be your application isn't finding it ?
make CC="gcc -L /usr/lib/mysql/libmysqlclient.so"
.. may be used to get it included.
.....
|
|
|
01-28-2010, 03:25 AM
|
#3
|
Member
Registered: Jul 2008
Location: Ghent, Belgium
Distribution: Fedora, CentOS
Posts: 694
Original Poster
Rep:
|
Thank you for your feedback.
Code:
yum install mysql-devel
Package mysql-devel-5.0.77-4.el5_4.1.x86_64 already installed and latest version
Package mysql-devel-5.0.77-4.el5_4.1.i386 already installed and latest version
Nothing to do
bash-3.2# locate libmysqlclient
/usr/lib/mysql/libmysqlclient.a
/usr/lib/mysql/libmysqlclient.so
/usr/lib/mysql/libmysqlclient.so.15
/usr/lib/mysql/libmysqlclient.so.15.0.0
/usr/lib/mysql/libmysqlclient_r.a
/usr/lib/mysql/libmysqlclient_r.so
/usr/lib/mysql/libmysqlclient_r.so.15
/usr/lib/mysql/libmysqlclient_r.so.15.0.0
/usr/lib64/mysql/libmysqlclient.a
/usr/lib64/mysql/libmysqlclient.so
/usr/lib64/mysql/libmysqlclient.so.15
/usr/lib64/mysql/libmysqlclient.so.15.0.0
/usr/lib64/mysql/libmysqlclient_r.a
/usr/lib64/mysql/libmysqlclient_r.so
/usr/lib64/mysql/libmysqlclient_r.so.15
/usr/lib64/mysql/libmysqlclient_r.so.15.0.0
The Makefile reads :
Code:
app_cbmysql.o: app_cbmysql.c
$(CC) -pipe -I/usr/include/mysql -L/usr/lib/mysql $(CFLAGS) -c -o app_cbmysql.o app_cbmysql.c
app_cbmysql.so: app_cbmysql.o
$(CC) -shared -Xlinker -x -o $@ $< -I/usr/include/mysql -L/usr/lib/mysql -lmysqlclient
depend: .depend
.depend:
./mkdep $(CFLAGS) `ls *.c`
|
|
|
01-29-2010, 01:47 AM
|
#4
|
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,520
|
Probable issues ... continued : 3)
You are building a 64 - bit application (x86_64) ? ?
.. and the Makefile specifyes a 32-bit lib in /usr/lib/mysql/,
causing :
" skipping incompatible /usr/lib/mysql/libmysqlclient.so "
( Sorry, didn't see that the first time, I read post #1 ).
You cannot link to 32 bit libmysqlclient.so with a 64 bit
linker ( = ld ).
.....
|
|
|
01-29-2010, 03:38 AM
|
#5
|
Member
Registered: Jul 2008
Location: Ghent, Belgium
Distribution: Fedora, CentOS
Posts: 694
Original Poster
Rep:
|
I am building on a 64-bit Xen, yes.
In the Makefile, I find the following :
Quote:
CFLAGS+=$(shell if [ -d /usr/local/mysql/include ]; then echo "-I/usr/local/mysql/include"; fi)
CFLAGS+=$(shell if [ -d /usr/include/mysql ]; then echo "-I/usr/include/mysql"; fi)
CFLAGS+=$(shell if [ -d /usr/local/include/mysql ]; then echo "-I/usr/local/include/mysql"; fi)
CFLAGS+=$(shell if [ -d /opt/mysql/include/mysql ]; then echo "-I/opt/mysql/include/mysql"; fi)
MLFLAGS=
MLFLAGS+=$(shell if [ -d /usr/lib/mysql ]; then echo "-L/usr/lib/mysql"; fi)
MLFLAGS+=$(shell if [ -d /usr/lib64/mysql ]; then echo "-L/usr/lib64/mysql"; fi)
MLFLAGS+=$(shell if [ -d /usr/local/mysql/lib ]; then echo "-L/usr/local/mysql/lib"; fi)
MLFLAGS+=$(shell if [ -d /usr/local/lib/mysql ]; then echo "-L/usr/local/lib/mysql"; fi)
MLFLAGS+=$(shell if [ -d /opt/mysql/lib/mysql ]; then echo "-L/opt/mysql/lib/mysql"; fi)
|
Doesn't this mean that there is looked for 64bit or 32bit libraries ??
Could it be that it first locates the 32bit-directory and therefore can not compile with a 64bit linker ??
I have both the libraries installed, but the lib64 is never used...
If this is the problem, can I then remove the 32bit-libs ?? Or would it be saver to create a symlink ?
Is it possible I will have problems with other programs on my system ?
|
|
|
01-29-2010, 05:46 AM
|
#6
|
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,520
|
Quote:
Is it possible I will have problems with other programs on my system ?
|
I don't think so, but you will find out.
Quote:
2) Could it be that it first locates the 32bit-directory and
therefore can not compile with a 64bit linker ??
I have both the libraries installed, but the lib64 is never used..
1) If this is the problem, can I then remove the 32bit-libs ??
|
1) Not using the i386 ' -devel ' libraries : You can remove
mysql-devel.i386 , is used for nothing but compiling.
And if you have other "lib<name>-devel.i386" : Remove them.
Can always be brought back, if ever again required.
2) After the '-devel.i386' are removed : Please do the command :
make distclean
.. and check that Makefile and config.status are deleted.
./configure will then create a new Makefile, hopefully
with the right libraries included.
.....
Last edited by knudfl; 01-29-2010 at 05:47 AM.
|
|
|
01-29-2010, 07:01 AM
|
#7
|
Member
Registered: Jul 2008
Location: Ghent, Belgium
Distribution: Fedora, CentOS
Posts: 694
Original Poster
Rep:
|
Quote:
Originally Posted by knudfl
./configure will then create a new Makefile, hopefully
with the right libraries included.
.....
|
There is no configure-file... just the Makefile.
Code:
-rw-r--r-- 1 admin-voipcenter admin-voipcenter 25027 Jan 27 16:54 app_cbmysql.c
-rw-rw-r-- 1 root root 42632 Jan 27 16:55 app_cbmysql.o
-rw-r--r-- 1 admin admin 526 Jan 27 16:54 cb-extensions.conf.sample
-rw-r--r-- 1 admin admin 329 Jan 27 16:54 cbmysql.conf
-rw-r--r-- 1 admin admin 250 Jan 27 16:54 db-admin-user-create.txt
-rw-r--r-- 1 admin admin 2768 Jan 27 16:54 db-table-create-v5.txt
-rw-r--r-- 1 admin admin 3740 Jan 27 16:54 db-tables-v5.txt
-rw-r--r-- 1 admin admin 383 Jan 27 16:54 extensions.conf-sample
-rw-r--r-- 1 admin admin 2178 Jan 27 16:54 Makefile
Also :
Code:
bash-3.2# make distclean
make: *** No rule to make target `distclean'. Stop.
Last edited by jonaskellens; 01-29-2010 at 07:03 AM.
|
|
|
01-30-2010, 06:36 AM
|
#8
|
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,520
|
cp Makefile Makefile-back ( to have a backup ).
.. and then you can edit the Makefile to point to /usr/lib64
.. like ..
$(CC) -pipe -I/usr/include/mysql -L/usr/lib64/mysql $(CFLAGS) \
-c -o app_cbmysql.o app_cbmysql.c
..... Good luck ..  ..
.....
|
|
|
All times are GMT -5. The time now is 07:44 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|