LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices

Reply
 
Search this Thread
Old 10-17-2009, 10:36 PM   #1
feiyinziiu
LQ Newbie
 
Registered: Oct 2009
Posts: 7

Rep: Reputation: 0
Red face arm-none-linux-gnueabi/bin/ld: cannot find -lbluetooth


hello

Recently I compile the bluetooth test.Before compile ,I have install bluez-libs,bluez-utils.
When I use gcc to compile
gcc -o bluetest bluetest.c -lbluetooth
that works well.It can run correctly.
But if using arm-linux-gcc to compile,I get those problems below:

[root@feiyinziiu home]# arm-linux-gcc -o bluetest bluetest.c -lbluetooth

/usr/local/arm/4.3.2/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.2/../../../../arm-none-linux-gnueabi/bin/ld: cannot find -lbluetooth
collect2: ld returned 1 exit status




what can I do ?

Thank you.
 
Old 10-17-2009, 10:47 PM   #2
jhwilliams
Senior Member
 
Registered: Apr 2007
Location: Portland, OR
Distribution: Debian, Android, LFS
Posts: 1,168

Rep: Reputation: 206Reputation: 206Reputation: 206
Hi feiyinziiu,

First, a bit of a science experiment. Can we reduce
Quote:
/usr/local/arm/4.3.2/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.2/../../../../arm-none-linux-gnueabi/bin/ld
to its reduced echelon form?

Solution:
Quote:
/usr/local/arm/4.3.2/arm-none-linux-gnueabi/bin/ld
The program above appears to be complaining that it does not have bluez-libz for the ARM processor. Well, it probably doesn't! apt-getting bluez-whatever will only get the libraries compiled for your local architecture (read: not ARM.) You will need to install bluetooth libraries for the ARM architecture into your /usr/local/arm/lib/ dir (most likely. or wherever the rest of your ARM libs are.)

Best,
Jameson

Last edited by jhwilliams; 10-17-2009 at 10:49 PM.
 
Old 10-17-2009, 11:17 PM   #3
feiyinziiu
LQ Newbie
 
Registered: Oct 2009
Posts: 7

Original Poster
Rep: Reputation: 0
Red face

Quote:
Originally Posted by jhwilliams View Post
Hi feiyinziiu,

First, a bit of a science experiment. Can we reduce to its reduced echelon form?

Solution:

The program above appears to be complaining that it does not have bluez-libz for the ARM processor. Well, it probably doesn't! apt-getting bluez-whatever will only get the libraries compiled for your local architecture (read: not ARM.) You will need to install bluetooth libraries for the ARM architecture into your /usr/local/arm/lib/ dir (most likely. or wherever the rest of your ARM libs are.)

Best,
Jameson


Thanks for your reply.

yesterday,I have cross compiled the bluez-libs and bluez-util for the ARM.And I have successfully transplant the libs and util to my ARM board

But how can I install bluetooth libraries for ARM on PC?

Because of cross-compiling my bluetoot test program on PC,how can I install bluetooth libraries for the ARM?
my bluetoot lib is like this:

[root@feiyinziiu lib]# pwd
/usr/local/lib
[root@feiyinziiu lib]# ls
alsa-lib libbluetooth.a libbluetooth.so libbluetooth.so.1.0.25 libbluetooth.so.2.11.2
bluetooth libbluetooth.la libbluetooth.so.1 libbluetooth.so.2 pkgconfig


Thank you!

Last edited by feiyinziiu; 10-17-2009 at 11:21 PM. Reason: description error
 
Old 10-17-2009, 11:20 PM   #4
jhwilliams
Senior Member
 
Registered: Apr 2007
Location: Portland, OR
Distribution: Debian, Android, LFS
Posts: 1,168

Rep: Reputation: 206Reputation: 206Reputation: 206
Quote:
Originally Posted by feiyinziiu View Post
But how can I install bluetooth libraries for ARM on PC?
You could install a library whose bytecode was "0000" to your PC. It wouldn't do anything, but you could install it. So too can you install ARM libraries that don't do anything on your PC, but do on the target architecture.

If you've cross compiled the bluetooth libs for ARM, just copy them to the appropriate directory in which your ARM compiler looks for libaries via the -l flag.

cp /path/to/arm/bluetoothlib/libbluez.so /path/to/arm/ld/library/path/libbluez.so

Last edited by jhwilliams; 10-17-2009 at 11:22 PM.
 
Old 10-18-2009, 01:30 AM   #5
feiyinziiu
LQ Newbie
 
Registered: Oct 2009
Posts: 7

Original Poster
Rep: Reputation: 0
Wink

Quote:
Originally Posted by jhwilliams View Post
You could install a library whose bytecode was "0000" to your PC. It wouldn't do anything, but you could install it. So too can you install ARM libraries that don't do anything on your PC, but do on the target architecture.

If you've cross compiled the bluetooth libs for ARM, just copy them to the appropriate directory in which your ARM compiler looks for libaries via the -l flag.

cp /path/to/arm/bluetoothlib/libbluez.so /path/to/arm/ld/library/path/libbluez.so
[root@feiyinziiu lib]# pwd
/usr/local/arm/4.3.2/arm-none-linux-gnueabi/libc/armv4t/usr/lib

haha!.Thank you very much.I have solve the problem under your guiding.

I found it difficult for me to get the path of the arm-linux-gcc looks for libraries via the -l flag.

But,the other day ,I have completed a programm with the pthread.
# arm-linux-gcc -o xxx xxx.c -lpthread
it work correctly.

so,I turn to find the pthread.
# locate pthread

/usr/lib/libgpgme++-pthread.so.1.0.0
/usr/lib/libgpgme-pthread.so.11
/usr/lib/libgpgme-pthread.so.11.6.4
/usr/lib/libpthread.a
/usr/lib/libpthread.so
/usr/lib/libpthread_nonshared.a
/usr/lib/kde4/devel/libgpgme++-pthread.so
/usr/lib/perl5/5.10.0/i386-linux-thread-multi/bits/pthreadtypes.ph
/usr/local/arm/4.3.2/arm-none-linux-gnueabi/libc/armv4t/lib/libpthread-2.8.so
/usr/local/arm/4.3.2/arm-none-linux-gnueabi/libc/armv4t/lib/libpthread.so.0
/usr/local/arm/4.3.2/arm-none-linux-gnueabi/libc/armv4t/usr/lib/libpthread.a
/usr/local/arm/4.3.2/arm-none-linux-gnueabi/libc/armv4t/usr/lib/libpthread.so
/usr/local/arm/4.3.2/arm-none-linux-gnueabi/libc/armv4t/usr/lib/libpthread_nonshared.a


finally,I copy the bluetooth lib to the direction.


But I have much doubt about the cross-compiling.
Above all,the bluez-lib has been cross compiled by arm-linux-gcc compiler(Before I transplant the libs,I cross compiled the libs).But I copy the the bluez-lib to that path,when I do tihs:
# arm-linux-gcc -o bluetest bluetest.c -lbluetooth

That is to say,those libs have to be recompiled.
How can the cross compiler recognize the libs?
 
  


Reply

Tags
bluetooth


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
which binary should I use to crosscompile binaries in /bin for arm mrmuds Linux - Wireless Networking 1 06-23-2009 07:44 AM
Compile the linux2.6.14.1 for arm must ues the arm-linux-gcc-3.4.4? frankyue Linux - Embedded & Single-board computer 2 12-20-2008 07:28 AM
When do i get "/arm-elf/bin/ld:cannot find -lc" while compiling my project rameshsatyavaram Linux - Newbie 0 09-10-2008 03:31 PM
/arm-linux-uclibc/bin/ld: cannot find -lcrypto tosatishpatel Linux - Software 0 03-20-2006 11:53 PM
Is '/usr/bin/find' reliable if '/bin/ls' has been replaced? DigaMe Linux - Security 2 11-12-2004 10:42 PM


All times are GMT -5. The time now is 02:49 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration