|
-
July 16th, 2009, 03:24 AM
#1
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
-
July 20th, 2009, 03:53 PM
#2
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|