<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Hi Everyone,<br><br> I had a compilation problem with my bluetooth application. In my source code bluez.c, function hci_get_route, hic_open_dev, etc., are called. I already installed the bluetooth stack to the toolchain. I check that /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/usr/lib has the libbluetooth static and shared objects, and /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/usr/include has all the required header files, such as hci.h, hci_lib.h, bluetooth.h. By the way, I already add "-lbluetooth" to the projectdir/src/Makefile.am" (openmoko_sample_LDADD = @DEPENDENCIES_LIBS@ -lbluetooth). om-config runs well, and I check the resulted projectdir/src/Makefile, the bluetooth library is already added into this file (openmoko_sample_LDADD = -lmokoui2 -lgtk-x11-2.0 -lgdk-x11-2.0 .....
-lbluetooth)<br><br> However, when I run "make" command under the projectdir. I run into some errors (link errors), the compilation is correct since I saw the corresponding object (bluez.o) file is generated, and I use "nm bluez.o" to check the external symbols, and find those called functions are there. By the way, "nm libbluetooth.so" lists those functions as well. <br><br> The error prompts is like:<br> bluez.o: in function main:<br> bluez.c: (.text+0x3c): undefined reference to "hci_open_dev"<br> bluez.c: (.text+0x3c): undefined reference to "hci_get_route"<br> .....<br><br> My phone is the newest GAT02. I checked LDFLAGS environment variable does not include /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/usr/lib, only include /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/lib, but when I add
/usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/usr/lib into the LDFLAGS, and re-run om-config,...., I still got the same error. <br> <br> Another question, gtk-x11-2.0 is under the /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/usr/lib, LDFLAGS only includes /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/lib, but I can successfully build a GUI program and run at the phone. Why that happen? Is that (/usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/usr/lib) the default library search path for the toolchain?<br> <br><br> Very much appreciate your help<br><br>Jun<br> <br><br><br></td></tr></table><br>