Author Topic: Code::Blocks and Windows Bluetooth API  (Read 7581 times)

madmox

  • Guest
Code::Blocks and Windows Bluetooth API
« on: September 06, 2008, 02:53:09 pm »
Hello everybody,

I'm a novice with code::blocks (and actually in developping on windows). I'm trying to use Windows Bluetooth API in order to use RFCOMM sockets on a PC. I need the appropriate functions and structures which are included in the file "ws2bth.h", which I downloaded with the Windows Server 2008 SDK (including .net framework 3.5). I'm on Windows XP SP2.

The problem I have now is to configure code::blocks! I want to use the MinGW32 compiler, but I don't really know what I need to change in the build options. I tried many things such as adding the paths ("C:\Program Files\Microsoft SDK's\...\includes\" and "C:\...\lib\") in the linker settings and/or in the search directories, I also tried copying the appropriate headers (ws2bth.h, something like bthdef.h, etc.) in the include directory of MinGW32, but it doesn't seem to work: each time I have errors in the compilation (either the header files are not found, or there are errors in them...).

Well, I just think I'm doing everything wrong, so maybe you could give me some help...

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: Code::Blocks and Windows Bluetooth API
« Reply #1 on: September 06, 2008, 04:13:04 pm »
madmox: you need to be much more specific about your project setup before anyone can help you. should should also turn on full compiler logging in global compiler settings/other settings and report the error messages. are you able to get a basic helloworld app to compile and run?

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Code::Blocks and Windows Bluetooth API
« Reply #2 on: September 06, 2008, 04:39:07 pm »
The problem I have now is to configure code::blocks! I want to use the MinGW32 compiler, but I don't really know what I need to change in the build options. I tried many things such as adding the paths ("C:\Program Files\Microsoft SDK's\...\includes\" and "C:\...\lib\") in the linker settings and/or in the search directories, I also tried copying the appropriate headers (ws2bth.h, something like bthdef.h, etc.) in the include directory of MinGW32, but it doesn't seem to work: each time I have errors in the compilation (either the header files are not found, or there are errors in them...).

You can't use VC compiled libs with MinGW.
Be a part of the solution, not a part of the problem.

madmox

  • Guest
Re: Code::Blocks and Windows Bluetooth API
« Reply #3 on: September 06, 2008, 05:16:14 pm »
Then, how do I use the Bluetooth stack on windows with MinGW32? I already saw .lib files used with MinGW, that's why I tried this way. But what can I do except using Visual Studio compiler??

About my project setup... I have no access to my project right now (not at home ^^) but as far as I remember, it's a default Win32 empty project, with MinGW compiler, and no other option has been modified. I need to access to ws2bth.h in one file (here are examples of structs and functions needed):

http://msdn.microsoft.com/en-us/library/aa450944.aspx
http://msdn.microsoft.com/en-us/library/aa450300.aspx

Actually I need to run the application on an embedded plateform running on Windows CE 5.0, but I need to test it on the PC before. And my application starts and runs as long as I don't use bluetooth sockets functionnalities (and don't include ws2bth.h).

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9618
Re: Code::Blocks and Windows Bluetooth API
« Reply #4 on: September 08, 2008, 10:04:15 am »
You can't use VC compiled libs with MinGW.
That's not entirely correct. Actually MinGW works just fine with most VC compiled libs (I do this every day). But there are exceptions, indeed.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ