qmk / qmk_firmware

Open-source keyboard firmware for Atmel AVR and Arm USB families
https://qmk.fm
GNU General Public License v2.0
18.28k stars 39.38k forks source link

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

Closed henrebotha closed 6 years ago

henrebotha commented 6 years ago

System:

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.

henrebotha commented 6 years ago

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)

drashna commented 6 years ago

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 avr-gcc@7.3
brew pin osx-cross/avr/avr-gcc

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

henrebotha commented 6 years ago

Sick, thanks @drashna!

henrebotha commented 6 years ago

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]')
drashna commented 6 years ago

Ah, sorry, KEYMAP should be LAYOUT_ergodox

henrebotha commented 6 years ago

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?

drashna commented 6 years ago

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

drashna commented 6 years ago

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.