Menu

Build and Include Library (Windows)

Nikolaos Ftylitakis

Building the library

Here are the instructions for how to build the library. This step can be bypassed in case someone wants to use the already generated binaries contained in the project folder "bin/Windows/Release(or Debug)"

  1. Download and install Bluesoleil drivers. Unfortunately they are not free. Any drivers of version 6.x and above is fine.
  2. Get Bluesoleil SDK from here.
  3. Download and install Qt for Windows.
  4. (optional) If Visual Studio is going to be used as IDE then download and install the Qt plug-in.

If the IDE that is going to be used is Visual Studio then:

  1. To open QBluetoothZero project, open Visual Studio and go under Qt-> Open Qt Project File.
  2. Locate the QBluetoothZero.pro, select it and press OK.
  3. Now the project is created so go under Build -> Build Solution
  4. If _step 3___ was successful then the necessary files were generated

The outcome of this step that we are interested in is 2 files: QBluetoothZero.lib and QBluetoothZero.dll.

Including the library

So now, having the files from the previous step (either created or acquired for the bin folder of the project) we can proceed to including the library.

Apart from the above 2 files we are going to need and all the header files of the project. Copy them to a folder of your choise.

The following lines must be inserted in the .pro file of the project that is going to use the QBluetoothZero library.

Add in win32 scope:

win32 { 
    LIBS += -lQBluetoothZero
    INCLUDEPATH = QBluetoothZero
    HEADERS += QBluetoothZero.h
}

The LIBS label sets the location of the file containing the .lib file, the INCLUDEPATH sets the location of the header files and HEADERS is used to specify the exact headers to be included. (the paths in the code example are indicational, feel free to edit with your own path were you placed the library files)

At any case, whenever one of the library classes is to be used, the developer must include <qbluetoothzero>.</qbluetoothzero>