{"action":"created","issue":{"url":"https://api.github.com/repos/PaulStoffregen/cores/issues/111","labels_url":"https://api.github.com/repos/PaulStoffregen/cores/issues/111/labels{/name}","comments_url":"https://api.github.com/repos/PaulStoffregen/cores/issues/111/comments","events_url":"https://api.github.com/repos/PaulStoffregen/cores/issues/111/events","html_url":"https://github.com/PaulStoffregen/cores/issues/111","id":128360981,"number":111,"title":"Compilation error using gcc-arm-embedded-4.9.3 in teensy3 using provided makefile without arduino ","user":{"login":"rzetterberg","id":766350,"avatar_url":"https://avatars.githubusercontent.com/u/766350?v=3","gravatar_id":"","url":"https://api.github.com/users/rzetterberg","html_url":"https://github.com/rzetterberg","followers_url":"https://api.github.com/users/rzetterberg/followers","following_url":"https://api.github.com/users/rzetterberg/following{/other_user}","gists_url":"https://api.github.com/users/rzetterberg/gists{/gist_id}","starred_url":"https://api.github.com/users/rzetterberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rzetterberg/subscriptions","organizations_url":"https://api.github.com/users/rzetterberg/orgs","repos_url":"https://api.github.com/users/rzetterberg/repos","events_url":"https://api.github.com/users/rzetterberg/events{/privacy}","received_events_url":"https://api.github.com/users/rzetterberg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-01-23T23:47:33Z","updated_at":"2016-01-29T15:15:02Z","closed_at":null,"body":"I'm trying to use my teensy 3.1 without Arduino on Linux. But I'm getting a compile error using gcc-arm-embedded-4.9.3. I'm running `make` inside the `cores/teensy3` directory without arduino. Here's the compiler error output:\r\n\r\n```\r\narm-none-eabi-g++ -std=gnu++0x -felide-constructors -fno-exceptions -fno-rtti -Wall -g -Os -mcpu=cortex-m4 -mthumb -MMD -DF_CPU=48000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -DUSING_MAKEFILE -D__MK20DX256__ -DARDUINO=10600 -DTEENSYDUINO=121 -I.  -c -o Stream.o Stream.cpp\r\nIn file included from WProgram.h:14:0,\r\n                 from Arduino.h:1,\r\n                 from Stream.cpp:23:\r\navr_functions.h:97:104: error: 'char* utoa(unsigned int, char*, int)' was declared 'extern' and later 'static' [-fpermissive]\r\n static inline char * utoa(unsigned int val, char *buf, int radix) __attribute__((always_inline, unused));\r\n                                                                                                        ^\r\nIn file included from /nix/store/a10h1v4iyw1m4kcxzqb0dgjzzkw42fm2-gcc-arm-embedded-4.9-2015q1-20150306/arm-none-eabi/include/stdlib.h:11:0,\r\n                 from WProgram.h:4,\r\n                 from Arduino.h:1,\r\n                 from Stream.cpp:23:\r\n/nix/store/a10h1v4iyw1m4kcxzqb0dgjzzkw42fm2-gcc-arm-embedded-4.9-2015q1-20150306/arm-none-eabi/include/stdlib.h:184:8: note: previous declaration of 'char* utoa(unsigned int, char*, int)'\r\n char * _EXFUN(utoa,(unsigned, char *, int));\r\n        ^\r\nIn file included from WProgram.h:14:0,\r\n                 from Arduino.h:1,\r\n                 from Stream.cpp:23:\r\navr_functions.h:99:95: error: 'char* itoa(int, char*, int)' was declared 'extern' and later 'static' [-fpermissive]\r\n static inline char * itoa(int val, char *buf, int radix) __attribute__((always_inline, unused));\r\n                                                                                               ^\r\nIn file included from /nix/store/a10h1v4iyw1m4kcxzqb0dgjzzkw42fm2-gcc-arm-embedded-4.9-2015q1-20150306/arm-none-eabi/include/stdlib.h:11:0,\r\n                 from WProgram.h:4,\r\n                 from Arduino.h:1,\r\n                 from Stream.cpp:23:\r\n/nix/store/a10h1v4iyw1m4kcxzqb0dgjzzkw42fm2-gcc-arm-embedded-4.9-2015q1-20150306/arm-none-eabi/include/stdlib.h:183:8: note: previous declaration of 'char* itoa(int, char*, int)'\r\n char * _EXFUN(itoa,(int, char *, int));\r\n        ^\r\n<builtin>: recipe for target 'Stream.o' failed\r\nmake: *** [Stream.o] Error 1\r\n```\r\n\r\nIf I add `-fpermissive` to `CPPFLAGS` I get a linker error instead:\r\n\r\n```\r\narm-none-eabi-gcc -Os -Wl,--gc-sections,--defsym=__rtc_localtime=0 --specs=nano.specs -mcpu=cortex-m4 -mthumb -Tmk20dx256.ld -o main.elf usb_m\r\nerial3.o usb_dev.o usb_keyboard.o keylayouts.o usb_midi.o usb_joystick.o ser_print.o pins_teensy.o usb_rawhid.o nonstd.o eeprom.o usb_mem.o us\r\nusb_desc.o serial1.o mk20dx128.o serial2.o analog.o math_helper.o touch.o usb_seremu.o usb_serial.o new.o HardwareSerial1.o DMAChannel.o Print\r\nnst.o Stream.o IPAddress.o Tone.o AudioStream.o yield.o main.o usb_flightsim.o HardwareSerial3.o WString.o HardwareSerial2.o avr_emulation.o W\r\nntervalTimer.o -lm\r\nPrint.o: In function `utoa':\r\n/home/zed/development/embedded_c/teensy3_test/tmp/teensy-template/cores/teensy3/avr_functions.h:98: multiple definition of `utoa'\r\nHardwareSerial1.o:/home/zed/development/embedded_c/teensy3_test/tmp/teensy-template/cores/teensy3/avr_functions.h:98: first defined here\r\nPrint.o: In function `itoa':\r\n/home/zed/development/embedded_c/teensy3_test/tmp/teensy-template/cores/teensy3/avr_functions.h:100: multiple definition of `itoa'\r\nHardwareSerial1.o:/home/zed/development/embedded_c/teensy3_test/tmp/teensy-template/cores/teensy3/avr_functions.h:100: first defined here\r\nusb_inst.o: In function `utoa':\r\n/home/zed/development/embedded_c/teensy3_test/tmp/teensy-template/cores/teensy3/avr_functions.h:98: multiple definition of `utoa'\r\nHardwareSerial1.o:/home/zed/development/embedded_c/teensy3_test/tmp/teensy-template/cores/teensy3/avr_functions.h:98: first defined here\r\nusb_inst.o: In function `itoa':\r\n/home/zed/development/embedded_c/teensy3_test/tmp/teensy-template/cores/teensy3/avr_functions.h:100: multiple definition of `itoa'\r\nHardwareSerial1.o:/home/zed/development/embedded_c/teensy3_test/tmp/teensy-template/cores/teensy3/avr_functions.h:100: first defined here\r\nStream.o: In function `utoa':\r\n/home/zed/development/embedded_c/teensy3_test/tmp/teensy-template/cores/teensy3/avr_functions.h:98: multiple definition of `utoa'\r\nHardwareSerial1.o:/home/zed/development/embedded_c/teensy3_test/tmp/teensy-template/cores/teensy3/avr_functions.h:98: first defined here\r\nStream.o: In function `itoa':\r\n/home/zed/development/embedded_c/teensy3_test/tmp/teensy-template/cores/teensy3/avr_functions.h:100: multiple definition of `itoa'\r\nHardwareSerial1.o:/home/zed/development/embedded_c/teensy3_test/tmp/teensy-template/cores/teensy3/avr_functions.h:100: first defined here\r\nIPAddress.o: In function `utoa':\r\n/home/zed/development/embedded_c/teensy3_test/tmp/teensy-template/cores/teensy3/avr_functions.h:98: multiple definition of `utoa'\r\nHardwareSerial1.o:/home/zed/development/embedded_c/teensy3_test/tmp/teensy-template/cores/teensy3/avr_functions.h:98: first defined here\r\nIPAddress.o: In function `itoa':\r\n/home/zed/development/embedded_c/teensy3_test/tmp/teensy-template/cores/teensy3/avr_functions.h:100: multiple definition of `itoa'\r\nHardwareSerial1.o:/home/zed/development/embedded_c/teensy3_test/tmp/teensy-template/cores/teensy3/avr_functions.h:100: first defined here\r\nTone.o: In function `utoa':\r\n/home/zed/development/embedded_c/teensy3_test/tmp/teensy-template/cores/teensy3/avr_functions.h:98: multiple definition of `utoa'\r\nHardwareSerial1.o:/home/zed/development/embedded_c/teensy3_test/tmp/teensy-template/cores/teensy3/avr_functions.h:98: first defined here\r\nTone.o: In function `itoa':\r\n/home/zed/development/embedded_c/teensy3_test/tmp/teensy-template/cores/teensy3/avr_functions.h:100: multiple definition of `itoa'\r\nHardwareSerial1.o:/home/zed/development/embedded_c/teensy3_test/tmp/teensy-template/cores/teensy3/avr_functions.h:100: first defined here\r\nAudioStream.o: In function `utoa':\r\n/home/zed/development/embedded_c/teensy3_test/tmp/teensy-template/cores/teensy3/avr_functions.h:98: multiple definition of `utoa'\r\nHardwareSerial1.o:/home/zed/development/embedded_c/teensy3_test/tmp/teensy-template/cores/teensy3/avr_functions.h:98: first defined here\r\nAudioStream.o: In function `itoa':\r\n/home/zed/development/embedded_c/teensy3_test/tmp/teensy-template/cores/teensy3/avr_functions.h:100: multiple definition of `itoa'\r\nHardwareSerial1.o:/home/zed/development/embedded_c/teensy3_test/tmp/teensy-template/cores/teensy3/avr_functions.h:100: first defined here\r\nyield.o: In function `utoa':\r\n/home/zed/development/embedded_c/teensy3_test/tmp/teensy-template/cores/teensy3/avr_functions.h:98: multiple definition of `utoa'\r\nHardwareSerial1.o:/home/zed/development/embedded_c/teensy3_test/tmp/teensy-template/cores/teensy3/avr_functions.h:98: first defined here\r\nyield.o: In function `itoa':\r\n/home/zed/development/embedded_c/teensy3_test/tmp/teensy-template/cores/teensy3/avr_functions.h:100: multiple definition of `itoa'\r\nHardwareSerial1.o:/home/zed/development/embedded_c/teensy3_test/tmp/teensy-template/cores/teensy3/avr_functions.h:100: first defined here\r\nmain.o: In function `utoa':\r\n/home/zed/development/embedded_c/teensy3_test/tmp/teensy-template/cores/teensy3/avr_functions.h:98: multiple definition of `utoa'\r\nHardwareSerial1.o:/home/zed/development/embedded_c/teensy3_test/tmp/teensy-template/cores/teensy3/avr_functions.h:98: first defined here\r\nmain.o: In function `itoa':\r\n/home/zed/development/embedded_c/teensy3_test/tmp/teensy-template/cores/teensy3/avr_functions.h:100: multiple definition of `itoa'\r\nHardwareSerial1.o:/home/zed/development/embedded_c/teensy3_test/tmp/teensy-template/cores/teensy3/avr_functions.h:100: first defined here\r\nHardwareSerial3.o: In function `utoa':\r\n/home/zed/development/embedded_c/teensy3_test/tmp/teensy-template/cores/teensy3/HardwareSerial.h:174: multiple definition of `utoa'\r\nHardwareSerial1.o:/home/zed/development/embedded_c/teensy3_test/tmp/teensy-template/cores/teensy3/avr_functions.h:98: first defined here\r\nHardwareSerial3.o: In function `itoa':\r\n/home/zed/development/embedded_c/teensy3_test/tmp/teensy-template/cores/teensy3/HardwareSerial.h:175: multiple definition of `itoa'\r\nHardwareSerial1.o:/home/zed/development/embedded_c/teensy3_test/tmp/teensy-template/cores/teensy3/avr_functions.h:100: first defined here\r\nWString.o: In function `utoa':\r\n/home/zed/development/embedded_c/teensy3_test/tmp/teensy-template/cores/teensy3/avr_functions.h:98: multiple definition of `utoa'\r\nHardwareSerial1.o:/home/zed/development/embedded_c/teensy3_test/tmp/teensy-template/cores/teensy3/avr_functions.h:98: first defined here\r\nWString.o: In function `itoa':\r\n/home/zed/development/embedded_c/teensy3_test/tmp/teensy-template/cores/teensy3/avr_functions.h:100: multiple definition of `itoa'\r\nHardwareSerial1.o:/home/zed/development/embedded_c/teensy3_test/tmp/teensy-template/cores/teensy3/avr_functions.h:100: first defined here\r\nHardwareSerial2.o: In function `utoa':\r\n/home/zed/development/embedded_c/teensy3_test/tmp/teensy-template/cores/teensy3/HardwareSerial.h:174: multiple definition of `utoa'\r\nHardwareSerial1.o:/home/zed/development/embedded_c/teensy3_test/tmp/teensy-template/cores/teensy3/avr_functions.h:98: first defined here\r\nHardwareSerial2.o: In function `itoa':\r\n/home/zed/development/embedded_c/teensy3_test/tmp/teensy-template/cores/teensy3/HardwareSerial.h:175: multiple definition of `itoa'\r\nHardwareSerial1.o:/home/zed/development/embedded_c/teensy3_test/tmp/teensy-template/cores/teensy3/avr_functions.h:100: first defined here\r\ncollect2: error: ld returned 1 exit status\r\nMakefile:92: recipe for target 'main.elf' failed\r\nmake: *** [main.elf] Error 1\r\n```\r\n\r\nI can supply more information if needed!"},"comment":{"url":"https://api.github.com/repos/PaulStoffregen/cores/issues/comments/176803452","html_url":"https://github.com/PaulStoffregen/cores/issues/111#issuecomment-176803452","issue_url":"https://api.github.com/repos/PaulStoffregen/cores/issues/111","id":176803452,"user":{"login":"wingunder","id":8417528,"avatar_url":"https://avatars.githubusercontent.com/u/8417528?v=3","gravatar_id":"","url":"https://api.github.com/users/wingunder","html_url":"https://github.com/wingunder","followers_url":"https://api.github.com/users/wingunder/followers","following_url":"https://api.github.com/users/wingunder/following{/other_user}","gists_url":"https://api.github.com/users/wingunder/gists{/gist_id}","starred_url":"https://api.github.com/users/wingunder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wingunder/subscriptions","organizations_url":"https://api.github.com/users/wingunder/orgs","repos_url":"https://api.github.com/users/wingunder/repos","events_url":"https://api.github.com/users/wingunder/events{/privacy}","received_events_url":"https://api.github.com/users/wingunder/received_events","type":"User","site_admin":false},"created_at":"2016-01-29T15:15:02Z","updated_at":"2016-01-29T15:15:02Z","body":"@PaulStoffregen Yes, thanks, it works for both my tool chains, using std=gnu++0x."}}