Skip Ribbon Commands
Skip to main content

Quick Launch

Todd Klindt's home page > Todd Klindt's SharePoint Admin Blog > Posts > “fatal error: vmdcl.h: No such file or directory” with Arduino IDE and Linkit One
December 26
“fatal error: vmdcl.h: No such file or directory” with Arduino IDE and Linkit One

For Christmas I was a good little boy and I got a gift I was really looking forward to, a LinkIt One board. This board is a like an Arduino board, but has wireless capabilities built in. I haven’t messed with anything like this since I was about 12 with an old Radio Shack 200-in-1 kit, but I was very excited. The experience has been a lot of fun, but I did stumble onto one issue that kicked my butt for a while. In true tech blogger fashion, I decided to share my defeat, and triumphant comeback with the world.

When I unwrapped the LinkIt One I hastily ripped apart the box and started hooking things up. Being a Microsoft guy, I’m used to clicking Next a lot to install things. Installing the drivers and programming environment for the LinkIt One board was a little clumsier than that. The documentation pointed me to this “Getting Started” link and it mostly worked. The driver installation was a little different, but it was close enough. The USB to Serial adapter drivers loaded correctly and I was able to connect the Arduino IDE to the COM ports that the LinkIt One was using. I thought I was well on my way to being the next Nikola Tesla, until I couldn’t upload my very first sketch. Sad smile 

The first sketch the documentation told me to upload was Blink. It’s a simple sketch that simply blinks the LED on the LinkIt One. I loaded it up in the Arduino IDE (Arduino 1.6.7) and hit “upload.” The IDE whirred and then spit out this unfortunate bit of sadness:


For the sake of people Googling (or heaven forbid, Binging) this error because they’re getting it themselves, here is the text in all its glory:

Warning: platform.txt from core 'MediaTek ARM7 EJ-S (32-bits) Boards' contains deprecated"{compiler.path}{}" {} "{build.path}/{archive_file}" "{object_file}", automatically converted to"{compiler.path}{}" {} "{archive_file_path}" "{object_file}". Consider upgrading this core.

In file included from sketch\Blink.ino.cpp:1:0:

C:\Users\me\AppData\Local\Arduino15\packages\LinkIt\hardware\arm\1.1.17\cores\arduino/Arduino.h:38:19: fatal error: vmdcl.h: No such file or directory

#include "vmdcl.h"


compilation terminated.

exit status 1

Error compiling.

It’s been over 20 years since I’ve taken any computer science courses, but I was able to piece together the problem. The Arduino.h file was trying include vmdcl.h and couldn’t find it. I verified the file did exist on my machine. It was in the C:\Users\username\AppData\Local\Arduino15\packages\LinkIt\hardware\arm\1.1.17\system\libmtk\include directory. That meant it was installed, but for whatever reason it wasn’t in a directory where the compiler could find it. I was a little out of my league here, so I jumped over to Google to see if the Internet could save me.

It did! I found a few hits on my error. The page that had my solution was on the MediaTek  forums. The entire solution is in that thread, but I thought I’d blog it to get it all in one place.

For me, the solution was two small edits to the platform.txt file in C:\Users\me\AppData\Local\Arduino15\packages\LinkIt\hardware\arm\1.1.17\ directory. That file, and this directory are created when you add board support for the LinkIt One to the Arduino IDE. It’s supposed to tell the compiler where everything is at for that platform. Somehow, it didn’t get set up correctly and my stuff was failing.

Thanks to that forum thread I was able to fix it by making these two edits to the platform.txt file. Before you make any edits to your own platform.txt file, back it up. Back it up twice to be safe. Then open it up in your favorite text editor and make the following two changes (highlighted in yellow).

Line 20: Search "compiler.cpp.flags="

Append -I{build.system.path}/libmtk to the end of the line.

Original line:
compiler.cpp.flags=-c -g -O2 -fvisibility=hidden -fpic -mthumb -mlittle-endian -nostdlib -fno-non-call-exceptions -fno-rtti -fno-exceptions -Dprintf=iprintf

Fixed line:
compiler.cpp.flags=-c -g -O2 -fvisibility=hidden -fpic -mthumb -mlittle-endian -nostdlib -fno-non-call-exceptions -fno-rtti -fno-exceptions -Dprintf=iprintf -I{build.system.path}/libmtk/include -I{build.system.path}/libmtk

Line 58: Search for "syscalls"

Add /core in the middle of the line.

Original line:
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mcpu={build.mcu} "-T{build.variant.path}/{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" -o "{build.path}/{build.project_name}.elf" "-L{build.path}" -lm -fpic -pie -Wl,--entry=gcc_entry -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-unresolved-symbols -Wl,--start-group "{build.path}/syscalls_mtk.c.o" {object_files} "{build.variant.path}/{build.variant_system_lib}" "{build.path}/{archive_file}" -Wl,--end-group

Fixed line:
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mcpu={build.mcu} "-T{build.variant.path}/{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" -o "{build.path}/{build.project_name}.elf" "-L{build.path}" -lm -fpic -pie -Wl,--entry=gcc_entry -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-unresolved-symbols -Wl,--start-group "{build.path}/core/syscalls_mtk.c.o" {object_files} "{build.variant.path}/{build.variant_system_lib}" "{build.path}/{archive_file}" -Wl,--end-group

You’ll have to stop and restart the IDE for those changes to take effect.

After those two changes I was able to upload the Blink sketch and my LinkIt One is happily blinking its LED at me.





This helped ! :) Didn't solve the compile, but gave me the next error :).

 on 12/30/2015 8:49 AM


This helped ! :) Didn't solve the compile, but gave me the next error :).

 on 12/30/2015 10:38 AM

This Worked

 on 1/10/2016 10:13 AM


Saved my day =)
 on 2/11/2016 3:04 AM

can't find

I can't find that two line.I use IDE 1.1.21 , can you help me to fix it?
 on 4/7/2016 2:38 AM

can't find

I can't find that two line.I use IDE 1.1.21 , can you help me to fix it?
 on 4/7/2016 2:48 AM

How to create a orphan site

 on 11/21/2016 3:27 AM

Add Comment

Items on this list require content approval. Your submission will not appear in public views until approved by someone with proper rights. More information on content approval.


Body *

Today's date *

Select a date from the calendar.
Please enter today's date so I know you are a real person


Want a message when I reply to your comment? Put your Twitter handle here.



 Please Support my Sponsors