# Error when trying to compile the default firmware

**URL:** <https://community.keyboard.io/t/error-when-trying-to-compile-the-default-firmware/1450>\
**Category:** Programming\
**Created:** [May 2, 2018, 8:11pm UTC](https://community.keyboard.io/t/error-when-trying-to-compile-the-default-firmware/1450 "2018-05-02T20:11:23Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![snowleap](https://avatars.discourse-cdn.com/v4/letter/s/898d66/32.png) [@snowleap](https://community.keyboard.io/u/snowleap)\
**Post date:** [May 2, 2018, 8:11pm UTC](https://community.keyboard.io/t/error-when-trying-to-compile-the-default-firmware/1450/1 "2018-05-02T20:11:24Z")

</div>

> ```
> C:\Users\colon\AppData\Local\Temp\arduino_modified_sketch_933048\Model01-Firmware.ino:60:46: fatal error: Kaleidoscope-HostPowerManagement.h: No such file or directory
> 
> #include "Kaleidoscope-HostPowerManagement.h"
> 
> ^
> 
> compilation terminated.
> 
> Multiple libraries were found for "HID.h"
> Used: C:\Users\colon\AppData\Local\Arduino15\packages\keyboardio\hardware\avr\1.22.0\libraries\HID
> Not used: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\HID
> exit status 1
> Error compiling for board Keyboardio Model 01.
> 
> ```

When I comment out the inclusion of the header file I instead get another error.

> Arduino: 1.8.5 (Windows 10), Board: “Keyboardio Model 01”
> 
> Model01-Firmware:131: error: expected constructor, destructor, or type conversion before ‘(’ token
> 
> KEYMAPS(
> 
> ```
> ^
> 
> ```
> 
> Multiple libraries were found for “HID.h”  
> Used: C:\Users\colon\AppData\Local\Arduino15\packages\keyboardio\hardware\avr\1.22.0\libraries\HID  
> Not used: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\HID  
> exit status 1  
> expected constructor, destructor, or type conversion before ‘(’ token
> 
> This report would have more information with  
> “Show verbose output during compilation”  
> option enabled in File → Preferences.

---

<div class="post-metadata">

**Author:** ![Chet\_Sandberg](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/chet_sandberg/32/1299_2.png) [@Chet\_Sandberg](https://community.keyboard.io/u/Chet_Sandberg)\
**Post date:** [May 11, 2018, 8:35pm UTC](https://community.keyboard.io/t/error-when-trying-to-compile-the-default-firmware/1450/2 "2018-05-11T20:35:27Z")

</div>

I have this exact problem and have gotten zero help.

---

<div class="post-metadata">

**Author:** ![algernon](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/algernon/32/4404_2.png) [@algernon](https://community.keyboard.io/u/algernon)\
**Post date:** [May 11, 2018, 8:43pm UTC](https://community.keyboard.io/t/error-when-trying-to-compile-the-default-firmware/1450/3 "2018-05-11T20:43:19Z")

</div>

I think the problem both of you are experiencing stems from installing Arduino-Boards via the IDE, but using the factory firmware from a git checkout.

Does this describe the situation? If so, that’s reasonably easy to fix.

---

<div class="post-metadata">

**Author:** ![jesse](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/jesse/32/361_2.png) [@jesse](https://community.keyboard.io/u/jesse)\
**Post date:** [May 12, 2018, 7:54pm UTC](https://community.keyboard.io/t/error-when-trying-to-compile-the-default-firmware/1450/4 "2018-05-12T19:54:02Z")

</div>

Hi folks,

@Chet_Sandberg - I’m so sorry. The Host Power Management error @snowleap mentioned didn’t show up in the error message you mailed us. If it had, I would have been able to pinpoint the problem much more quickly.

@algernon is correct - this appears to have been caused by using a version of the Model01-Firmware.ino sketch file from a fresh git checkout, but libraries from Arduino. In general, this should work or, if not, should fail with an intelligible error message. The fact that it did not is my fault.

You’d mentioned that this was caused by following the instructions at [https://github.com/keyboardio/Kaleidoscope/wiki/edit-a-keymap](https://github.com/keyboardio/Kaleidoscope/wiki/edit-a-keymap), but I’m not seeing a place in there where we point you to the GitHub version of Model01-Firmware. If you happen to remember where we told you to do that, could you point me at it so I can go correct things?

Regardless, I’ve just updated the Arduino version of Kaleidoscope to something somewhat newer, with support for the sketch you were working with. This should help improve things, though we’re approaching another transition that may cause a breaking change, though this time we’re putting a bunch of effort into steering you in the right direction if things go wrong.

---

<div class="post-metadata">

**Author:** ![functionalLlama](https://avatars.discourse-cdn.com/v4/letter/f/a6a055/32.png) [@functionalLlama](https://community.keyboard.io/u/functionalLlama)\
**Post date:** [November 15, 2018, 1:40pm UTC](https://community.keyboard.io/t/error-when-trying-to-compile-the-default-firmware/1450/5 "2018-11-15T13:40:36Z")

</div>

@jesse

Hi, I am having this exact problem. However I don’t see a solution, only that you’re saying you’re to blame. How do I upload my keymap if it won’t compile?

---

<div class="post-metadata">

**Author:** ![jesse](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/jesse/32/361_2.png) [@jesse](https://community.keyboard.io/u/jesse)\
**Post date:** [November 15, 2018, 5:29pm UTC](https://community.keyboard.io/t/error-when-trying-to-compile-the-default-firmware/1450/6 "2018-11-15T17:29:25Z")

</div>

@functionalLlama,

Can you tell me what version of the Arduino IDE you’re using and what version of Kaleidoscope is installed in the Arduino Boards Manager? If you installed Arduino through the Windows store, can you try a direct install? The store version is weirdly broken 😕

---

<div class="post-metadata">

**Author:** ![functionalLlama](https://avatars.discourse-cdn.com/v4/letter/f/a6a055/32.png) [@functionalLlama](https://community.keyboard.io/u/functionalLlama)\
**Post date:** [November 15, 2018, 6:43pm UTC](https://community.keyboard.io/t/error-when-trying-to-compile-the-default-firmware/1450/7 "2018-11-15T18:43:21Z")

</div>

Yep, that was the issue. I did a reinstall of my arduino IDE and tried flashing again, but ran into some process running bugs. A little searching revealed that I had to unplug the keyboard, and then plug it in while holding the prog key, reselect it from the COM port menu and then flash. Everything is working now! Thanks for the support, Jesse.

---

<div class="post-metadata">

**Author:** ![Daniel\_Raine](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/daniel_raine/32/2473_2.png) [@Daniel\_Raine](https://community.keyboard.io/u/Daniel_Raine)\
**Post date:** [January 17, 2019, 11:32pm UTC](https://community.keyboard.io/t/error-when-trying-to-compile-the-default-firmware/1450/8 "2019-01-17T23:32:03Z")

</div>

I’m running into this issue on OS X.

```auto
WARNING: Category 'Debug' in library Kaleidoscope-Hardware-Virtual is not valid. Setting to 'Uncategorized'
/Users/draine/kaleidoscope/Kaleidoscope-Bundle-Keyboardio/ProgrammerDvorak-Firmware/ProgrammerDvorak-Firmware.ino: In function 'void setup()':
ProgrammerDvorak-Firmware:359:16: error: 'class kaleidoscope::Kaleidoscope_' has no member named 'use'
   Kaleidoscope.use(
                ^
Multiple libraries were found for "HID.h"
 Used: /Users/draine/Documents/Arduino/hardware/keyboardio/avr/libraries/HID
 Not used: /private/var/folders/zp/0nr8rs3n2f38s7qj2rxv9mqsyr2q13/T/AppTranslocation/D048C911-B7E8-4092-B868-8AAF3F7B4B32/d/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/HID
exit status 1
'class kaleidoscope::Kaleidoscope_' has no member named 'use'

```

---

<div class="post-metadata">

**Author:** ![algernon](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/algernon/32/4404_2.png) [@algernon](https://community.keyboard.io/u/algernon)\
**Post date:** [January 17, 2019, 11:44pm UTC](https://community.keyboard.io/t/error-when-trying-to-compile-the-default-firmware/1450/9 "2019-01-17T23:44:20Z")

</div>

> [@Daniel\_Raine](#):
>
> `Kaleidoscope.use`

Regretfully, we had to change the way plugins are initialized, and while we did provide a backward compatibility layer, that has been removed by now. I’d recommend glancing through the [New Plugin API](https://github.com/keyboardio/Kaleidoscope/blob/master/UPGRADING.md#new-plugin-api) part of the upgrade guide, it has examples that show how to go from the old way to the new.

If that’s not sufficient, if you can share your sketch (by uploading it to GitHub or similar), I’m happy to take a look and propose a patch to fix it.

---

<div class="post-metadata">

**Author:** ![tiltowaitt](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/tiltowaitt/32/4764_2.png) [@tiltowaitt](https://community.keyboard.io/u/tiltowaitt)\
**Post date:** [January 18, 2019, 12:55am UTC](https://community.keyboard.io/t/error-when-trying-to-compile-the-default-firmware/1450/10 "2019-01-18T00:55:15Z")

</div>

> [@algernon](#):
>
> Regretfully, we had to change the way plugins are initialized, and while we did provide a backward compatibility layer, that has been removed by now.

The legacy stuff doesn’t work at all anymore? Does that mean I can take this block out of my repos?

```c++
// Legacy V1 API.
#if KALEIDOSCOPE_ENABLE_V1_PLUGIN_API
void AutoShift::begin() {
  Kaleidoscope.useEventHandlerHook(legacyEventHandler);
}

Key AutoShift::legacyEventHandler(Key mapped_key, byte row, byte col, uint8_t keyState) {
  EventHandlerResult r = ::AutoShift.onKeyswitchEvent(mapped_key, row, col, keyState);
  if (r == EventHandlerResult::OK)
    return mapped_key;
  return Key_NoKey;
}
#endif

```

---

<div class="post-metadata">

**Author:** ![algernon](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/algernon/32/4404_2.png) [@algernon](https://community.keyboard.io/u/algernon)\
**Post date:** [January 18, 2019, 12:58am UTC](https://community.keyboard.io/t/error-when-trying-to-compile-the-default-firmware/1450/11 "2019-01-18T00:58:26Z")

</div>

> [@tiltowaitt](#):
>
> The legacy stuff doesn’t work at all anymore?

Correct, it does not. We removed the v1 compat layer in late August (2018-08-20).

> [@tiltowaitt](#):
>
> Does that mean I can take this block out of my repos?

Yup! Happy axing! 🙂

---

<div class="post-metadata">

**Author:** ![tiltowaitt](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/tiltowaitt/32/4764_2.png) [@tiltowaitt](https://community.keyboard.io/u/tiltowaitt)\
**Post date:** [January 18, 2019, 2:35am UTC](https://community.keyboard.io/t/error-when-trying-to-compile-the-default-firmware/1450/12 "2019-01-18T02:35:11Z")

</div>

> [@algernon](#):
>
> Yup! Happy axing! 🙂

Cool. What about:

```c++
// Backwards compatibility
typedef plugin::NewPlugin NewPlugin;
```

---

<div class="post-metadata">

**Author:** ![algernon](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/algernon/32/4404_2.png) [@algernon](https://community.keyboard.io/u/algernon)\
**Post date:** [January 18, 2019, 7:12am UTC](https://community.keyboard.io/t/error-when-trying-to-compile-the-default-firmware/1450/13 "2019-01-18T07:12:48Z")

</div>

> [@tiltowaitt](#):
>
> ```c++
> // Backwards compatibility 
> typedef plugin::NewPlugin NewPlugin;
> 
> ```

![Axe it!](https://canada1.discourse-cdn.com/flex031/uploads/keyboard/original/2X/0/04c03ebeee0ad29cc5a14a9159f5c1e3be0ed583.png)
