arm-none-linux-gnueabi/bin/ld: cannot find -lbluetooth
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 ?
First, a bit of a science experiment. Can we reduce
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
[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
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
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
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?
|All times are GMT -5. The time now is 08:07 PM.|