error with Bluetooth and RFCOMM sockets
Hello. I'm trying to construct a simple program that connects to a bluetooth device using RFCOMM sockets. I've stumbled on a page that has some sample code: http://www.lenholgate.com/archives/000102.html
I have installed Windows SDK and Visual Studio (express edition). The problem is that if I compile my program, the compiler dumps a bunch of errors. I've come to the conclusion that the header Ws2bth.h is giving those errors even if I write an "empty" C++ program and only include the header. Is there a reaon wy this is happening? Do I need to turn on a switch to the compiler. Please help.
Greets,
Luka
Re: error with Bluetooth and RFCOMM sockets
Your #include files are probably included in the wrong order. Try it in the following order:
Code:
#include <Winsock2.h>
#include <Bthsdpdef.h>
#include <Ws2bth.h>
#include <BluetoothAPIs.h>
See "Using Bluetooth" at http://msdn.microsoft.com/en-us/libr...58(VS.85).aspx which explains this ordering of includes.
Mike