0

Hi I'm trying to use bluez source code to control some stuff in my code.

In my cmake I first start doing instruction like

include_directories(${CMAKE_SOURCE_DIR}/../bluez/attrib/)

then

aux_source_directory(${CMAKE_SOURCE_DIR}/../bluez/attrib/ SRC_BLUEZ_ATTRIB_LIST)

and finaly add SRC_BLUEZ_ATTRIB_LIST to my add_executable

But I still have

undefined reference to gatt_connect(char const*, char const*, char const*, char const*, int, int, void (*)(_GIOChannel*, _GError*, void*), _GError**)

Any suggestion?

Peter Petrik
  • 9,701
  • 5
  • 41
  • 65
user1796260
  • 297
  • 1
  • 4
  • 20

1 Answers1

1

Use extern "C" in your c++ source file

extern "C" {
   #include "gatttool.h"
}
Community
  • 1
  • 1
Peter Petrik
  • 9,701
  • 5
  • 41
  • 65