Export to GitHub

btstack - issue #165

Unable to build btstack


Posted on May 31, 2011 by Grumpy Dog

What steps will reproduce the problem? 1. Checkout btstack 2. Follow all instructions in Getting Started page (http://code.google.com/p/btstack/wiki/GettingStarted)

When I try to build btstack from the checked out folder I get a lot of errors, and I cannot build it. However I precisely followed every step of the getting started page from the wiki. For making configure.sh i wrote "./configure --target=iphone --with-sdk-version=3.2" (my Xcode version is 3.2 What's the problem ?

What version of the product are you using? On what operating system? I use the last version of btstack from the svn repository (r1113) and my OS is Mac OSX 10.6.7

Please provide any additional information below. This is the log : http://cy.itmfr.net/error_log.txt

Thank You, Tiz38

Comment #1

Posted on Jun 4, 2011 by Grumpy Dog

Ok I'm stupid, my SDK is 4.2 and not 3.2^^

So I configured for 4.2 but when I try to compile i still get errors !

/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-gcc-4.2.1 -I/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/usr/include -I/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/usr/lib/gcc/arm-apple-darwin10/4.2.1/include -F/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/System/Library/Frameworks -Werror -I../include -o test test.c -framework CoreFoundation -framework Foundation -F/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/System/Library/Frameworks -L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/usr/lib -framework Foundation -framework CoreFoundation -framework UIKit -L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/System/Library/Frameworks/IOKit.framework/Versions/A /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/System/Library/PrivateFrameworks/BluetoothManager.framework/BluetoothManager -lIOKit -lobjc -lBTstack -L../src ld: library not found for -lBTstack collect2: ld returned 1 exit status

make: * [test] Error 1

Please Help me ! Thank You !

Comment #2

Posted on Jun 4, 2011 by Swift Ox

in the main folder, try "make clean' and then "make" again

Comment #3

Posted on Jun 4, 2011 by Grumpy Dog

Thank you but this not worked...

This is the terminal output :

Tiz:btstack Thomas$ make clean Making clean in PatchBlueTool rm -f PatchBlueTool Making clean in SpringBoardAccess rm -f SpringBoardAccess.dylib SpringBoardAccess-test Making clean in example rm -f test mitm rfcomm-cat rfcomm-echo inquiry l2cap-server l2cap-throughput obex Making clean in src rm -rf libBTstack* BTdaemon *.o Making clean in . make[1]: Nothing to be done for `clean-am'. Tiz:btstack Thomas$ cd example Tiz:example Thomas$ make /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-gcc-4.2.1 -I/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/usr/include -I/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/usr/lib/gcc/arm-apple-darwin10/4.2.1/include -F/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/System/Library/Frameworks -Werror -I../include -o test test.c -framework CoreFoundation -framework Foundation -F/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/System/Library/Frameworks -L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/usr/lib -framework Foundation -framework CoreFoundation -framework UIKit -L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/System/Library/Frameworks/IOKit.framework/Versions/A /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/System/Library/PrivateFrameworks/BluetoothManager.framework/BluetoothManager -lIOKit -lobjc -lBTstack -L../src ld: library not found for -lBTstack collect2: ld returned 1 exit status make: * [test] Error 1

Thank you :)

Comment #4

Posted on Jun 4, 2011 by Swift Ox

it doesn't work because your ran "make" inside the "example" folder. I didn't tell you that.

run "make" in the main folder. also try to read & understand the error output: it says " library not found for -lBTstack". libBTstack.dylib is build in "src" btw. later you can build examples in "examples" folder.

Comment #5

Posted on Jun 4, 2011 by Grumpy Dog

OK...

Sorry for my stupidity. Indeed it's working nice, but i can't find the line where to place the wiimote's MAC adress in test.c :)

Thank you again, Tiz38

Comment #6

Posted on Jun 4, 2011 by Swift Ox

line 48

Comment #7

Posted on Jun 4, 2011 by Grumpy Dog

Thank you, i replace "0x76, 0x6d, 0x62, 0xdb, 0xca, 0x73 " by my MAC adress ?

But where can I fond this adresse on the wiimote ?

Sorry for theses stupid questions...

Comment #8

Posted on Jun 4, 2011 by Swift Ox

make WiiMote discoverable (1+2 at the same time -> blinking), run inquiry example. .. or pair with a computer and check there.

Comment #9

Posted on Jun 4, 2011 by Grumpy Dog

Comment deleted

Comment #10

Posted on Jun 4, 2011 by Grumpy Dog

Thank you I finally suceed and the test tool work fine!

Now i tried to launch the wiimote opengl xcode project file but i get 16 errors when I compile!

ld: warning: ignoring file /Users/Thomas/btstack/src/libbtstack.dylib, file was built for unsupported file format which is not the architecture being linked (i386) ld: warning: ignoring file /Users/Thomas/btstack/src/libBTstack.dylib, file was built for unsupported file format which is not the architecture being linked (i386) Undefined symbols for architecture i386: "_bt_flip_addr", referenced from: -[WiiMoteOpenGLDemoAppDelegate btstackManager:handlePacketWithType:forChannel:andData:withLen:] in WiiMoteOpenGLDemoAppDelegate.o -[BTstackManager handleRemoteNameCached:] in BTstackManager.o -[BTstackManager handleRemoteName:] in BTstackManager.o -[BTstackManager discoveryHandleEvent:withLen:] in BTstackManager.o "_bt_send_cmd", referenced from: -[WiiMoteOpenGLDemoAppDelegate btstackManager:handlePacketWithType:forChannel:andData:withLen:] in WiiMoteOpenGLDemoAppDelegate.o -[WiiMoteOpenGLDemoAppDelegate discoveryStoppedBTstackManager:] in WiiMoteOpenGLDemoAppDelegate.o -[BTstackManager activate] in BTstackManager.o -[BTstackManager deactivate] in BTstackManager.o -[BTstackManager startDiscovery] in BTstackManager.o -[BTstackManager stopDiscovery] in BTstackManager.o -[BTstackManager activationHandleEvent:withLen:] in BTstackManager.o ... "_bt_send_l2cap", referenced from: -[WiiMoteOpenGLDemoAppDelegate btstackManager:handlePacketWithType:forChannel:andData:withLen:] in WiiMoteOpenGLDemoAppDelegate.o "_l2cap_create_channel", referenced from: -[WiiMoteOpenGLDemoAppDelegate btstackManager:handlePacketWithType:forChannel:andData:withLen:] in WiiMoteOpenGLDemoAppDelegate.o -[WiiMoteOpenGLDemoAppDelegate discoveryStoppedBTstackManager:] in WiiMoteOpenGLDemoAppDelegate.o "_OBJC_CLASS_$_CAEAGLLayer", referenced from: objc-class-ref in EAGLView.o "_run_loop_init", referenced from: -[BTstackManager init] in BTstackManager.o "_bt_register_packet_handler", referenced from: -[BTstackManager init] in BTstackManager.o "_bt_open", referenced from: -[BTstackManager activate] in BTstackManager.o "_hci_remote_name_request", referenced from: -[BTstackManager discoveryRemoteName] in BTstackManager.o "_hci_write_inquiry_mode", referenced from: -[BTstackManager startDiscovery] in BTstackManager.o -[BTstackManager discoveryHandleEvent:withLen:] in BTstackManager.o "_hci_inquiry", referenced from: -[BTstackManager discoveryRemoteName] in BTstackManager.o -[BTstackManager discoveryHandleEvent:withLen:] in BTstackManager.o "_btstack_set_system_bluetooth_enabled", referenced from: -[BTstackManager activationHandleEvent:withLen:] in BTstackManager.o "_btstack_get_system_bluetooth_enabled", referenced from: -[BTstackManager activate] in BTstackManager.o "_hci_remote_name_request_cancel", referenced from: -[BTstackManager stopDiscovery] in BTstackManager.o -[BTstackManager discoveryHandleEvent:withLen:] in BTstackManager.o "_btstack_set_power_mode", referenced from: -[BTstackManager deactivate] in BTstackManager.o -[BTstackManager activationHandleEvent:withLen:] in BTstackManager.o "_hci_inquiry_cancel", referenced from: -[BTstackManager stopDiscovery] in BTstackManager.o -[BTstackManager discoveryHandleEvent:withLen:] in BTstackManager.o ld: symbol(s) not found for architecture i386

collect2: ld returned 1 exit status

But my architecture in project settings is arm ! What's the problem pls?

Thank you for your full help :)

Attachments

Comment #11

Posted on Jun 6, 2011 by Grumpy Dog

Ok I compiled the project on my real device, & I still get one error !

Look at this screen for more infos :)

Thank you very much, Tiz38

Attachments

Comment #12

Posted on Sep 21, 2012 by Quick Panda

I have the same issue I tried copying the the header files into my project along with the .m files for inquiry and discovery and and I am getting an the same errors .'

As below :

ld: warning: ignoring file /Users/naderelnino/Documents/Xcode projects/Bluetoothapptest/Bluetoothapptest/libBTstack.dylib, file was built for unsupported file format ( 0xce 0xfa 0xed 0xfe 0x c 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked (i386): /Users/naderelnino/Documents/Xcode projects/Bluetoothapptest/Bluetoothapptest/libBTstack.dylib

Comment #13

Posted on Sep 25, 2012 by Swift Ox

you should use the CFLAGS to help Xcode find the header files instead of copying it. Your error indicates your mixing architectures - like using the iOS build for the simulator.

Status: Verified

Labels:
Type-Defect Priority-Medium