Skip to content

cannot compile #43

@chinglaito

Description

@chinglaito

I put all files in my Arduino library folder and tried to compile UPS.ino in the example folder and I got the following error messages. Keep complaining about something not declared. I am using a MacBook Pro with Arduino IDE
Version: 2.3.5
Date: 2025-04-02T13:14:21.480Z
CLI Version: 1.2.0

Copyright © 2025 Arduino SA

Any help is appreciated. I really want this to work out.

Error messages###########################

In file included from /Users/chinglaito/Documents/Arduino/libraries/HIDPowerDevice-master/examples/UPS/UPS.ino:1:0:
/Users/chinglaito/Documents/Arduino/libraries/HIDPowerDevice-master/src/HIDPowerDevice.h:117:18: error: 'Serial_' has not been declared
void setOutput(Serial_&);
^~~~~~~
/Users/chinglaito/Documents/Arduino/libraries/HIDPowerDevice-master/src/HIDPowerDevice.h:109:27: error: 'IPRODUCT' was not declared in this scope
const byte bProduct = IPRODUCT;
^~~~~~~~
/Users/chinglaito/Documents/Arduino/libraries/HIDPowerDevice-master/src/HIDPowerDevice.h:109:27: note: suggested alternative: 'PRADC'
const byte bProduct = IPRODUCT;
^~~~~~~~
PRADC
/Users/chinglaito/Documents/Arduino/libraries/HIDPowerDevice-master/src/HIDPowerDevice.h:110:32: error: 'IMANUFACTURER' was not declared in this scope
const byte bManufacturer = IMANUFACTURER;
^~~~~~~~~~~~~
/Users/chinglaito/Documents/Arduino/libraries/HIDPowerDevice-master/src/HIDPowerDevice.h:110:32: note: suggested alternative: 'HID_PD_MANUFACTURER'
const byte bManufacturer = IMANUFACTURER;
^~~~~~~~~~~~~
HID_PD_MANUFACTURER
/Users/chinglaito/Documents/Arduino/libraries/HIDPowerDevice-master/src/HIDPowerDevice.h:111:26: error: 'ISERIAL' was not declared in this scope
const byte bSerial = ISERIAL;
^~~~~~~
/Users/chinglaito/Documents/Arduino/libraries/HIDPowerDevice-master/src/HIDPowerDevice.h:111:26: note: suggested alternative: 'SERIAL'
const byte bSerial = ISERIAL;
^~~~~~~
SERIAL
/Users/chinglaito/Documents/Arduino/libraries/HIDPowerDevice-master/examples/UPS/UPS.ino: In function 'void setup()':
/Users/chinglaito/Documents/Arduino/libraries/HIDPowerDevice-master/examples/UPS/UPS.ino:61:31: error: cannot bind non-const lvalue reference of type 'int&' to an rvalue of type 'int'
PowerDevice.setOutput(Serial);
^
In file included from /Users/chinglaito/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/cores/arduino/Arduino.h:233:0,
from /Users/chinglaito/Library/Caches/arduino/sketches/E9E989274E18762C560EA93FF08B1CDE/sketch/UPS.ino.cpp:1:
/Users/chinglaito/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/cores/arduino/HardwareSerial.h:135:5: note: after user-defined conversion: HardwareSerial::operator bool()
operator bool() { return true; }
^~~~~~~~
In file included from /Users/chinglaito/Documents/Arduino/libraries/HIDPowerDevice-master/examples/UPS/UPS.ino:1:0:
/Users/chinglaito/Documents/Arduino/libraries/HIDPowerDevice-master/src/HIDPowerDevice.h:117:8: note: initializing argument 1 of 'void HIDPowerDevice_::setOutput(int&)'
void setOutput(Serial_&);
^~~~~~~~~
exit status 1

Compilation error: cannot bind non-const lvalue reference of type 'int&' to an rvalue of type 'int'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions