Expected class-name before ',' token

Hi when I try to compile this code arduino-bt-hid-proxy it gives me the following error at this point:

#KeyboardReporter.h
// Include guard
#pragma once

#include <Arduino.h>
#include "HID.h"
#include "HID-Settings.h"
#include "HID-APIs/DefaultKeyboardAPI.h"

class KeyboardReporter_ : public PluggableUSBModule, public DefaultKeyboardAPI
{
...
}

Error

In file included from /Users/name/Documents/Arduino/libraries/HID-Project/src/HID-APIs/KeyboardAPI.h:29:0,
                 from /Users/name/Documents/Arduino/libraries/HID-Project/src/HID-APIs/DefaultKeyboardAPI.h:27,
                 from /Users/name/Desktop/apple dongle/arduino-bt-hid-proxy-master/BTHID/KeyboardReporter.h:27,
                 from /Users/name/Desktop/apple dongle/arduino-bt-hid-proxy-master/BTHID/KeyboardReporter.cpp:24:
/Users/name/Documents/Arduino/libraries/HID-Project/src/HID-APIs/../KeyboardLayouts/ImprovedKeylayouts.h:54:21: note: #pragma message: Using default ASCII layout for keyboard modules
     #pragma message "Using default ASCII layout for keyboard modules"
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /Users/name/Desktop/apple dongle/arduino-bt-hid-proxy-master/BTHID/KeyboardReporter.cpp:24:0:
KeyboardReporter.h:30:52: error: expected class-name before ',' token
 class KeyboardReporter_ : public PluggableUSBModule, public DefaultKeyboardAPI
                                                    ^
KeyboardReporter.h:69:23: error: 'USBSetup' has not been declared
     int getDescriptor(USBSetup& setup);
                       ^~~~~~~~
KeyboardReporter.h:70:16: error: 'USBSetup' has not been declared
     bool setup(USBSetup& setup);
                ^~~~~~~~
/Users/name/Desktop/apple dongle/arduino-bt-hid-proxy-master/BTHID/KeyboardReporter.cpp: In constructor 'KeyboardReporter_::KeyboardReporter_()':
KeyboardReporter.cpp:93:46: error: class 'KeyboardReporter_' does not have any field named 'PluggableUSBModule'
 KeyboardReporter_::KeyboardReporter_(void) : PluggableUSBModule(1, 1, epType), protocol(HID_REPORT_PROTOCOL), idle(1), leds(0), featureReport(NULL), featureLength(0)
                                              ^~~~~~~~~~~~~~~~~~
KeyboardReporter.cpp:93:89: error: 'HID_REPORT_PROTOCOL' was not declared in this scope
 KeyboardReporter_::KeyboardReporter_(void) : PluggableUSBModule(1, 1, epType), protocol(HID_REPORT_PROTOCOL), idle(1), leds(0), featureReport(NULL), featureLength(0)
                                                                                         ^~~~~~~~~~~~~~~~~~~
/Users/name/Desktop/apple dongle/arduino-bt-hid-proxy-master/BTHID/KeyboardReporter.cpp:93:89: note: suggested alternative: 'HID_REPORTID_MOUSE'
 KeyboardReporter_::KeyboardReporter_(void) : PluggableUSBModule(1, 1, epType), protocol(HID_REPORT_PROTOCOL), idle(1), leds(0), featureReport(NULL), featureLength(0)
                                                                                         ^~~~~~~~~~~~~~~~~~~
                                                                                         HID_REPORTID_MOUSE
KeyboardReporter.cpp:95:14: error: 'EP_TYPE_INTERRUPT_IN' was not declared in this scope
  epType[0] = EP_TYPE_INTERRUPT_IN;
              ^~~~~~~~~~~~~~~~~~~~
/Users/name/Desktop/apple dongle/arduino-bt-hid-proxy-master/BTHID/KeyboardReporter.cpp:95:14: note: suggested alternative: 'EMPTY_INTERRUPT'
  epType[0] = EP_TYPE_INTERRUPT_IN;
              ^~~~~~~~~~~~~~~~~~~~
              EMPTY_INTERRUPT
KeyboardReporter.cpp:96:2: error: 'PluggableUSB' was not declared in this scope
  PluggableUSB().plug(this);
  ^~~~~~~~~~~~
/Users/name/Desktop/apple dongle/arduino-bt-hid-proxy-master/BTHID/KeyboardReporter.cpp: In member function 'int KeyboardReporter_::getInterface(uint8_t*)':
KeyboardReporter.cpp:102:2: error: 'HIDDescriptor' was not declared in this scope
  HIDDescriptor hidInterface = {
  ^~~~~~~~~~~~~
/Users/name/Desktop/apple dongle/arduino-bt-hid-proxy-master/BTHID/KeyboardReporter.cpp:102:2: note: suggested alternative: 'getDescriptor'
  HIDDescriptor hidInterface = {
  ^~~~~~~~~~~~~
  getDescriptor
KeyboardReporter.cpp:107:29: error: 'hidInterface' was not declared in this scope
  return USB_SendControl(0, &hidInterface, sizeof(hidInterface));
                             ^~~~~~~~~~~~
/Users/name/Desktop/apple dongle/arduino-bt-hid-proxy-master/BTHID/KeyboardReporter.cpp:107:29: note: suggested alternative: 'getInterface'
  return USB_SendControl(0, &hidInterface, sizeof(hidInterface));
                             ^~~~~~~~~~~~
                             getInterface
KeyboardReporter.cpp:107:9: error: 'USB_SendControl' was not declared in this scope
  return USB_SendControl(0, &hidInterface, sizeof(hidInterface));
         ^~~~~~~~~~~~~~~
/Users/name/Desktop/apple dongle/arduino-bt-hid-proxy-master/BTHID/KeyboardReporter.cpp: At global scope:
KeyboardReporter.cpp:110:38: error: 'int KeyboardReporter_::getDescriptor' is not a static data member of 'class KeyboardReporter_'
 int KeyboardReporter_::getDescriptor(USBSetup& setup)
                                      ^~~~~~~~
KeyboardReporter.cpp:110:38: error: 'USBSetup' was not declared in this scope
/Users/name/Desktop/apple dongle/arduino-bt-hid-proxy-master/BTHID/KeyboardReporter.cpp:110:38: note: suggested alternative: 'setup'
 int KeyboardReporter_::getDescriptor(USBSetup& setup)
                                      ^~~~~~~~
                                      setup
KeyboardReporter.cpp:132:31: error: 'bool KeyboardReporter_::setup' is not a static data member of 'class KeyboardReporter_'
 bool KeyboardReporter_::setup(USBSetup& setup)
                               ^~~~~~~~
KeyboardReporter.cpp:132:31: error: 'USBSetup' was not declared in this scope
/Users/name/Desktop/apple dongle/arduino-bt-hid-proxy-master/BTHID/KeyboardReporter.cpp:132:31: note: suggested alternative: 'setup'
 bool KeyboardReporter_::setup(USBSetup& setup)
                               ^~~~~~~~
                               setup
/Users/name/Desktop/apple dongle/arduino-bt-hid-proxy-master/BTHID/KeyboardReporter.cpp: In member function 'virtual int KeyboardReporter_::send()':
KeyboardReporter.cpp:224:18: error: 'pluggedEndpoint' was not declared in this scope
  return USB_Send(pluggedEndpoint | TRANSFER_RELEASE, &_keyReport, sizeof(_keyReport));
                  ^~~~~~~~~~~~~~~
KeyboardReporter.cpp:224:36: error: 'TRANSFER_RELEASE' was not declared in this scope
  return USB_Send(pluggedEndpoint | TRANSFER_RELEASE, &_keyReport, sizeof(_keyReport));
                                    ^~~~~~~~~~~~~~~~
/Users/name/Desktop/apple dongle/arduino-bt-hid-proxy-master/BTHID/KeyboardReporter.cpp:224:36: note: suggested alternative: '__ATOMIC_RELEASE'
  return USB_Send(pluggedEndpoint | TRANSFER_RELEASE, &_keyReport, sizeof(_keyReport));
                                    ^~~~~~~~~~~~~~~~
                                    __ATOMIC_RELEASE
KeyboardReporter.cpp:224:9: error: 'USB_Send' was not declared in this scope
  return USB_Send(pluggedEndpoint | TRANSFER_RELEASE, &_keyReport, sizeof(_keyReport));
         ^~~~~~~~
/Users/name/Desktop/apple dongle/arduino-bt-hid-proxy-master/BTHID/KeyboardReporter.cpp:224:9: note: suggested alternative: 'USBS0'
  return USB_Send(pluggedEndpoint | TRANSFER_RELEASE, &_keyReport, sizeof(_keyReport));
         ^~~~~~~~
         USBS0
/Users/name/Desktop/apple dongle/arduino-bt-hid-proxy-master/BTHID/KeyboardReporter.cpp: In member function 'virtual int KeyboardReporter_::sendReport(uint8_t*, size_t)':
KeyboardReporter.cpp:228:18: error: 'pluggedEndpoint' was not declared in this scope
  return USB_Send(pluggedEndpoint | TRANSFER_RELEASE, buf, len);
                  ^~~~~~~~~~~~~~~
KeyboardReporter.cpp:228:36: error: 'TRANSFER_RELEASE' was not declared in this scope
  return USB_Send(pluggedEndpoint | TRANSFER_RELEASE, buf, len);
                                    ^~~~~~~~~~~~~~~~
/Users/name/Desktop/apple dongle/arduino-bt-hid-proxy-master/BTHID/KeyboardReporter.cpp:228:36: note: suggested alternative: '__ATOMIC_RELEASE'
  return USB_Send(pluggedEndpoint | TRANSFER_RELEASE, buf, len);
                                    ^~~~~~~~~~~~~~~~
                                    __ATOMIC_RELEASE
KeyboardReporter.cpp:228:9: error: 'USB_Send' was not declared in this scope
  return USB_Send(pluggedEndpoint | TRANSFER_RELEASE, buf, len);
         ^~~~~~~~
In file included from /Users/name/Documents/Arduino/libraries/HID-Project/src/HID-APIs/KeyboardAPI.h:29:0,
                 from /Users/name/Documents/Arduino/libraries/HID-Project/src/HID-APIs/DefaultKeyboardAPI.h:27,
                 from /Users/name/Desktop/apple dongle/arduino-bt-hid-proxy-master/BTHID/KeyboardReporter.h:27,
                 from /Users/name/Desktop/apple dongle/arduino-bt-hid-proxy-master/BTHID/KeyboardParser.h:5,
                 from /Users/name/Desktop/apple dongle/arduino-bt-hid-proxy-master/BTHID/BTHID.ino:3:
/Users/name/Documents/Arduino/libraries/HID-Project/src/HID-APIs/../KeyboardLayouts/ImprovedKeylayouts.h:54:21: note: #pragma message: Using default ASCII layout for keyboard modules
     #pragma message "Using default ASCII layout for keyboard modules"
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/name/Desktop/apple dongle/arduino-bt-hid-proxy-master/BTHID/KeyboardReporter.cpp:228:9: note: suggested alternative: 'USBS0'
  return USB_Send(pluggedEndpoint | TRANSFER_RELEASE, buf, len);
         ^~~~~~~~
         USBS0
/Users/name/Desktop/apple dongle/arduino-bt-hid-proxy-master/BTHID/KeyboardReporter.cpp: In member function 'void KeyboardReporter_::wakeupHost()':
KeyboardReporter.cpp:233:2: error: 'USBDevice' was not declared in this scope
  USBDevice.wakeupHost();
  ^~~~~~~~~
In file included from /Users/name/Desktop/apple dongle/arduino-bt-hid-proxy-master/BTHID/KeyboardParser.h:5:0,
                 from /Users/name/Desktop/apple dongle/arduino-bt-hid-proxy-master/BTHID/BTHID.ino:3:
KeyboardReporter.h:30:52: error: expected class-name before ',' token
 class KeyboardReporter_ : public PluggableUSBModule, public DefaultKeyboardAPI
                                                    ^
KeyboardReporter.h:69:23: error: 'USBSetup' has not been declared
     int getDescriptor(USBSetup& setup);
                       ^~~~~~~~
KeyboardReporter.h:70:16: error: 'USBSetup' has not been declared
     bool setup(USBSetup& setup);
                ^~~~~~~~
In file included from /Users/name/Desktop/apple dongle/arduino-bt-hid-proxy-master/BTHID/BTHID.ino:3:0:
/Users/name/Desktop/apple dongle/arduino-bt-hid-proxy-master/BTHID/KeyboardParser.h: In member function 'virtual void KbdRptParser::Parse(USBHID*, bool, uint8_t, uint8_t*)':
KeyboardParser.h:34:16: error: 'TXLED1' was not declared in this scope
     if (ledOn) TXLED1;
                ^~~~~~
/Users/name/Desktop/apple dongle/arduino-bt-hid-proxy-master/BTHID/KeyboardParser.h:34:16: note: suggested alternative: 'TWD1'
     if (ledOn) TXLED1;
                ^~~~~~
                TWD1
KeyboardParser.h:35:10: error: 'TXLED0' was not declared in this scope
     else TXLED0;
          ^~~~~~
/Users/name/Desktop/apple dongle/arduino-bt-hid-proxy-master/BTHID/KeyboardParser.h:35:10: note: suggested alternative: 'TXEN0'
     else TXLED0;
          ^~~~~~
          TXEN0
/Users/name/Desktop/apple dongle/arduino-bt-hid-proxy-master/BTHID/BTHID.ino: In function 'void setup()':
BTHID:28:3: error: 'TXLED1' was not declared in this scope
   TXLED1;
   ^~~~~~
/Users/name/Desktop/apple dongle/arduino-bt-hid-proxy-master/BTHID/BTHID.ino:28:3: note: suggested alternative: 'TWD1'
   TXLED1;
   ^~~~~~
   TWD1
BTHID:32:5: error: 'TXLED0' was not declared in this scope
     TXLED0;
     ^~~~~~
/Users/name/Desktop/apple dongle/arduino-bt-hid-proxy-master/BTHID/BTHID.ino:32:5: note: suggested alternative: 'TXEN0'
     TXLED0;
     ^~~~~~
     TXEN0
exit status 1
expected class-name before ',' token

do you need to include "PluggableUSB.h"?

Hi @gcjr,
I had already tried adding:

PluggableUSB.h (2.0 KB)

#include "PluggableUSB.h"

but it gives me this error:

In file included from /Users/name/Desktop/apple dongle/arduino-bt-hid-proxy-modified/BTHID/MouseReporter.h:13:0,
                 from /Users/name/Desktop/apple dongle/arduino-bt-hid-proxy-modified/BTHID/MouseParser.h:5,
                 from /Users/name/Desktop/apple dongle/arduino-bt-hid-proxy-modified/BTHID/BTHID.ino:4:
/Users/name/Documents/Arduino/libraries/HID-Project/src/HID-Project.h:35:2: error: #error HID Project can only be used with an USB MCU.
 #error HID Project can only be used with an USB MCU.
  ^~~~~
exit status 1
Error compiling for board Arduino Uno.

What board are you compiling for?

Hi @groundFungus, It's an Arduino Uno clone.

Not sure how I missed that. Facepalm.

When it says USB MCU I am pretty sure that it means a processor with native USB host like the Leonardo or Pro Micro with the ATmega32u4 processor. An Uno, though it can be programmed with USB does not have native USB capability.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.