I am trying to upload this code to my Arduino Yun in Ubuntu and I keep getting this error:

Arduino: 1.5.8 (Linux), Board: "Arduino Yún"

Build options changed, rebuilding all
Using library FileIO in folder: /home/djloulou/Arduino/libraries/FileIO (legacy)

/home/djloulou/arduino-1.5.8/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=158 -DARDUINO_AVR_YUN -DARDUINO_ARCH_AVR -DUSB_VID=0x2341 -DUSB_PID=0x8041 -DUSB_MANUFACTURER= -DUSB_PRODUCT="Arduino Yun" -I/home/djloulou/arduino-1.5.8/hardware/arduino/avr/cores/arduino -I/home/djloulou/arduino-1.5.8/hardware/arduino/avr/variants/yun -I/home/djloulou/Arduino/libraries/FileIO /tmp/build8511320611227460765.tmp/sketch_dec01a.cpp -o /tmp/build8511320611227460765.tmp/sketch_dec01a.cpp.o
In file included from yun_datalogger.ino:31:0:
/home/djloulou/Arduino/libraries/FileIO/FileIO.h:12:19: fatal error: fstream: No such file or directory
 #include <fstream>
compilation terminated.
Error compiling.

I then tried in Windows and it works fine.

So I guess it's an ubuntu problem, I think I should install a new package or something but if someone could guide me throught this I would really appreciate it because I m really new in Ubuntu and I feel helpless.

  • Do you have fstream installed on the Ubuntu system? It's telling you that the compilation cannot find that library to include. I'm personally not sure where you might be able to get it, but I could do some Googling when I get home. Try looking in /home/djloulou/Arduino/libraries/FileIO/ and add what you find to the question. – Robobenklein Dec 15 '14 at 15:15
  • 1
    You can search for which package contains a file by doing a search like: dpkg -S fstream ... and then install that package. – jmunsch Dec 15 '14 at 18:13

I deleted all arduino files and reinstalled them and for some reason it worked. Probably i accidentally erased something in the first place.

Thanks anyways


fatal error: fstream: No such file or directory

By running: dpkg -S fstream

I get:

libstdc++-4.8-dev:amd64: /usr/include/c++/4.8/fstream
libstdc++-4.8-dev:amd64: /usr/include/c++/4.8/bits/fstream.tcc

I could then:

sudo apt-get install libstdc++-4.8-dev:amd64

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.