Qmk_firmware: Build error(s): implicit declaration of function 'KEYMAP' / initializer element is not constant

Created on 28 Jun 2018  路  8Comments  路  Source: qmk/qmk_firmware

System:

  • macOS 10.13.5
  • Zsh 5.5.1
  • GNU Make 3.81

Build errors:

QMK Firmware 0.6.49
WARNING:
 Some git sub-modules are out of date or modified, please consider runnning:
 make git-submodule
 You can ignore this warning if you are not compiling any ChibiOS keyboards,
 or if you have modified the ChibiOS libraries yourself.

Making ergodox_ez with keymap henrebotha

avr-gcc (GCC) 8.1.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Compiling: keyboards/ergodox_ez/twimaster.c                                                         [OK]
Compiling: keyboards/ergodox_ez/matrix.c                                                            [OK]
Compiling: keyboards/ergodox_ez/ergodox_ez.c                                                        [OK]
Compiling: keyboards/ergodox_ez/keymaps/henrebotha/keymap.c                                        keyboards/ergodox_ez/keymaps/henrebotha/keymap.c:33:18: error: implicit declaration of function 'KEYMAP'; did you mean 'KEYMAP_H'? [-Werror=implicit-function-declaration]
   [LAYER_HOME] = KEYMAP(
                  ^~~~~~
                  KEYMAP_H
keyboards/ergodox_ez/keymaps/henrebotha/keymap.c:33:18: error: initializer element is not constant
keyboards/ergodox_ez/keymaps/henrebotha/keymap.c:33:18: note: (near initialization for 'keymaps[0][0][0]')
> ...snip... <

It's been a while since I've built my firmware, so I don't know whether something fundamental has changed in QMK in the meantime. My keymap is a fork of the Ergodox EZ default keymap.

bug core help wanted needs doc

Most helpful comment

Ah, sorry, KEYMAP should be LAYOUT_ergodox

All 8 comments

In case it's relevant, my keymap lives here: https://github.com/henrebotha/qmk_keymap (I haven't pushed the QMK updates to origin/master yet)

The issue is that avr-gcc 8.1.0 isn't fully compatible with our build environment.
To fix this issue, you'll need to revert the version. To do so, run:

brew install [email protected]
brew pin osx-cross/avr/avr-gcc

This will revert to a working version, and prevent it from updating.

Sick, thanks @drashna!

Hang on... This doesn't work, I get the same issues with 7.3.0.

QMK Firmware 0.6.49
WARNING:
 Some git sub-modules are out of date or modified, please consider runnning:
 make git-submodule
 You can ignore this warning if you are not compiling any ChibiOS keyboards,
 or if you have modified the ChibiOS libraries yourself.

Making ergodox_ez with keymap henrebotha

avr-gcc (GCC) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Compiling: keyboards/ergodox_ez/twimaster.c                                                         [OK]
Compiling: keyboards/ergodox_ez/matrix.c                                                            [OK]
Compiling: keyboards/ergodox_ez/ergodox_ez.c                                                        [OK]
Compiling: keyboards/ergodox_ez/keymaps/henrebotha/keymap.c                                        keyboards/ergodox_ez/keymaps/henrebotha/keymap.c:33:18: error: implicit declaration of function 'KEYMAP'; did you mean 'KEYMAP_H'? [-Werror=implicit-function-declaration]
   [LAYER_HOME] = KEYMAP(
                  ^~~~~~
                  KEYMAP_H
keyboards/ergodox_ez/keymaps/henrebotha/keymap.c:33:18: error: initializer element is not constant
keyboards/ergodox_ez/keymaps/henrebotha/keymap.c:33:18: note: (near initialization for 'keymaps[0][0][0]')

Ah, sorry, KEYMAP should be LAYOUT_ergodox

Alright, seems to compile with that change. Thanks.

Do I understand correctly that the _pretty keymaps simply reorder the keys so you can lay out your keymap side-by-side in code?

Yes, correct. It's more "visually correct", but it's just a reordering of the matrix to do so.

And my first post was half wrong. The issue was the keymap, but ... the 8.1.0 avr-gcc version would have errored out when that was fixed, with a LUFA related error.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

levitanong picture levitanong  路  3Comments

MarkuBu picture MarkuBu  路  3Comments

kb3dow picture kb3dow  路  3Comments

fredizzimo picture fredizzimo  路  4Comments

drashna picture drashna  路  3Comments