I am trying to reproduce this 4-key-keyboard and for that I am trying to compile its source by compiling it with avr-gcc on my Linux box.
I managed to solve a couple errors thrown by the compiler by extending the command line with paramaters, but now I am stuck with the errors below. Thing is that quite a few demo projects on V-USB use the same libraries and throw the same errors and I don't want to wrestle through all the code to try and fix them for every project I want to check out. I realize the best way to go is to fix the errors in the source code, but although the errors below can trivially be solved, new errors are thrown that are much more complicated to solve and with all changes to the source code I have no guarantee that the resulting program will still actually work.
My question is: Does avr-gcc have some compatibility command line parameter that makes the code compile as if it was an older version of gcc?
This is the command I use to compile the sources:
avr-gcc main.c -I /usr/lib/avr/include/ -mmcu=attiny85 -DF_CPU=16000000 -Os -I ./usbdrv
These are the errors thrown by avr-gcc:
In file included from main.c:32:0:
./usbdrv/usbdrv.h:455:6: error: variable ‘usbDescriptorDevice’ must be const in order to be put into read-only section by means of ‘__attribute__((progmem))’
./usbdrv/usbdrv.h:461:6: error: variable ‘usbDescriptorConfiguration’ must be const in order to be put into read-only section by means of ‘__attribute__((progmem))’
./usbdrv/usbdrv.h:467:6: error: variable ‘usbDescriptorHidReport’ must be const in order to be put into read-only section by means of ‘__attribute__((progmem))’
./usbdrv/usbdrv.h:473:6: error: variable ‘usbDescriptorString0’ must be const in order to be put into read-only section by means of ‘__attribute__((progmem))’
./usbdrv/usbdrv.h:479:5: error: variable ‘usbDescriptorStringVendor’ must be const in order to be put into read-only section by means of ‘__attribute__((progmem))’
./usbdrv/usbdrv.h:485:5: error: variable ‘usbDescriptorStringDevice’ must be const in order to be put into read-only section by means of ‘__attribute__((progmem))’
./usbdrv/usbdrv.h:491:5: error: variable ‘usbDescriptorStringSerialNumber’ must be const in order to be put into read-only section by means of ‘__attribute__((progmem))’
main.c:105:14: error: variable ‘usbDescriptorHidReport’ must be const in order to be put into read-only section by means of ‘__attribute__((progmem))’
My configuration:
Ubuntu 13.10
avr-gcc (GCC) 4.7.2