LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


Reply
  Search this Thread
Old 01-27-2010, 10:09 AM   #1
jonaskellens
Member
 
Registered: Jul 2008
Location: Ghent, Belgium
Distribution: Fedora, CentOS
Posts: 632

Rep: Reputation: 33
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' ?
 
Old 01-27-2010, 01:26 PM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016 CentOS6.9 CentOS7.3 + 50+ other Linux OS, for test only.
Posts: 16,632

Rep: Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267
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.
.....
 
Old 01-28-2010, 03:25 AM   #3
jonaskellens
Member
 
Registered: Jul 2008
Location: Ghent, Belgium
Distribution: Fedora, CentOS
Posts: 632

Original Poster
Rep: Reputation: 33
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`
 
Old 01-29-2010, 01:47 AM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016 CentOS6.9 CentOS7.3 + 50+ other Linux OS, for test only.
Posts: 16,632

Rep: Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267
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 ).
.....
 
Old 01-29-2010, 03:38 AM   #5
jonaskellens
Member
 
Registered: Jul 2008
Location: Ghent, Belgium
Distribution: Fedora, CentOS
Posts: 632

Original Poster
Rep: Reputation: 33
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 ?
 
Old 01-29-2010, 05:46 AM   #6
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016 CentOS6.9 CentOS7.3 + 50+ other Linux OS, for test only.
Posts: 16,632

Rep: Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267
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.
 
Old 01-29-2010, 07:01 AM   #7
jonaskellens
Member
 
Registered: Jul 2008
Location: Ghent, Belgium
Distribution: Fedora, CentOS
Posts: 632

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by knudfl View Post
./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.
 
Old 01-30-2010, 06:36 AM   #8
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016 CentOS6.9 CentOS7.3 + 50+ other Linux OS, for test only.
Posts: 16,632

Rep: Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267
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 .. ..
.....
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to compile C++ programs.make:g++ command not found error.Error 127 PrathuD Programming 3 03-16-2009 12:44 PM
Error when trying to compile gnome-web-photo-0.5 jhilgeman Linux - Server 0 10-24-2008 05:26 PM
Apache HTTP web server 2.2.8 compile error gully300 Linux - Server 7 06-17-2008 02:16 AM
Web cam driver - can someone compile this small amount of src for me please? brownb2 Ubuntu 2 03-30-2007 03:42 PM
Compile madwifi, ... compile error , how can i do. ERBRMN Linux - Networking 3 03-08-2006 07:56 PM


All times are GMT -5. The time now is 07:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration