views:

85

answers:

2

The following code compiles fine when compiling as Mac OSX 10.6 as the active SDK (linked with the 10.5 frameworks, 10.5 set as the base SDK)

IOBluetoothHostController *controller = [IOBluetoothHostController defaultController];

However, if I compile it with Mac OSX 10.5 as the active SDK, I get an error message saying that IOBluetoothHostController is undeclared. How can I resolve this?

A: 

This isn't an answer, but something for you to check.

Have you added the appropriate Bluetooth framework to your project? Has there been a change in 10.6 with regard to the framework that IOBluetoothHostController belongs to?

Dale
Hey, thanks for the response. I looked in the IOBluetooth framework, and IOBluetoothHostController.h is in there. This is true for both the 10.6 and 10.5 base SDK... As I said, it does work if I say @class IOBluetoothHostController.
Ryan
That declaration doesn't do you any good if the header it's in isn't included/imported in the source file that tries to use it.
Azeem.Butt
My class' (which uses the IOBluetoothHostController) header file makes that import.
Ryan
+3  A: 

The problem is that the IOBluetoothHostController.h header is wrapped in:

#if BLUETOOTH_VERSION_MAX_ALLOWED >= BLUETOOTH_VERSION_2_0

I'm not sure exactly what's going on there, but I was able to get the header included by specifying:

#define BLUETOOTH_VERSION_USE_CURRENT 

in my prefix header.

Ken Aspeslagh
That said, thinking back I was not able to get any of the routines in the class to work properly on 10.5 so it's possible the class was still in progress and that's why they ifdef'd it out.
Ken Aspeslagh