News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Code::Blocks and Windows Bluetooth API

Started by madmox, September 06, 2008, 02:53:09 PM

Previous topic - Next topic

madmox

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...

dmoore

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?
Python plugins: [url="https://github.com/spillz/codeblocks-python"]https://github.com/spillz/codeblocks-python[/url]
Code::Blocks Daily Builds -- Ubuntu PPA: [url="https://launchpad.net/~damien-moore/+archive/codeblocks"]https://launchpad.net/~damien-moore/+archive/codeblocks[/url]

Biplab

Quote from: madmox on September 06, 2008, 02:53:09 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

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).

MortenMacFly

Quote from: Biplab on September 06, 2008, 04:39:07 PM
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: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]