Music Shield compile issues

Hi, sorry if I’m overlooking something simple, but I’ve been struggling with this for several hours.

Hi, I followed the instructions here: … sic_Shield
Section “For Arduino 1.0:”
(I had to make new folders for the portpins.h file)
(I had to rename the Fat16 rar file to a zip to unarchive it)

on two computers and have the same problem:

When I try to run and upload:

I get the following error:

musicPlayAll.cpp: In function ‘void loop()’:
musicPlayAll.cpp:63:9: error: ‘Play’ was not declared in this scope

If I comment out line 60: Play();

I get this error:
/home/michaelcole/arduino-1.0/libraries/MusicShieldNewSDLib/player.cpp:27:19: fatal error: Fat16.h: No such file or directory
compilation terminated.

Looking in player.cpp,

Fat16.h exists in libraries/Fat16

Why isn’t the compiler finding it?

Also, in player.cpp
#include <Fat16Util.h> is maybe pointing to the file Fat16util.h (note util vs Util)

I got this to work on my laptop last night :-/ When I came in today, all I can do is reproduce the problem…

I’m using an Arduino UNO I’ve used with a BlinkM on another project.
My IDE was downloaded from here:

What’s up? Thanks for looking! (383 KB)

Make sure that :
1.IDE ardruino1.0
2. replace the default portpins.h file of Arduino-1.0 program: …\arduino-1.0\hardware\tools\avr\avr\include\avr

Deray (379 KB)

Hi Deray,

Yes, the about box says 1.0

Yes, I put the portpins.h file there. But it didn’t replace any existing file - I had to make the folders avr/avr/include/avr myself. That’s suspicious. The linux version doesn’t have these folders. The windows version does. (see

Where do you download the IDE from?

I got mine from
(I’m using the 64-bit linux version)


Hey, after thinking about this, I removed the libraries and tried compiling the examples one at a time. It seems like MusicSchieldNewSDLib breaks the music_v1_2 “musicPlayAll” example when compiling with Linux. (I didn’t test with hardware…)

music_v1_2 -> musicPlayAll

  • Compiles when Fat16 and MusicShieldNewSDLib are not present.
  • Does not compile when only MusicShieldNewSDLib is present.
  • Does compile when only Fat16 is present
  • Does not compile w/ Fat16, MusicShieldNewSDLib, and copy Fat16util.h to Fat16Util.h

MusicShieldNewSDLib -> MusicPlayRandomly

  • Does not compile when music_v1_2 and Fat16 not present.
  • Does not compile when only Fat16 is present.
  • Does compile when only Fat16, and copy Fat16util.h to Fat16Util.h
  • Does compile w/ Fat16, music_v1_2, and copy Fat16util.h…

Hi Mike,
I succeed that use IDE1.0(windows) , downloaded If that the problem when be used on linux ? And the key I think is that I put the portpins.h file in “\arduino-1.0\hardware\tools\avr\avr\include\avr” , it replaced an existing file .


yeah,I know what is the problem of your libraries.
Do the step below of the music shield wiki.
`Use SD libraries:
1.Make sure there are songs in the micro sd card.
2.Download File:Music v1 for music shield.
3.Uncompress the package and put it in Arduino-1.0 program: …\arduino-1.0\libraries
4.Select the corresponding Arduino board, like Arduino UNO or Duemilanove or others.
5.Download a new portpins.h file and replace the default portpins.h file of Arduino-1.0 program: …\arduino-1.0\hardware\tools\avr\avr\include\avr
6.Run the arduino program compile and upload the sketch of music_v1_2 -> music into Arduino board.
7.Just enjoy.

Ignore Use Fat16 libraries step …If I put and File:Fat16 for Arduino1.0.rar
in my libraries , the issue will happened like you. (308 KB)

Just tested under Linux. Several things verified:

  1. Under Linux, we can’t find portpins.h, so we do not need it, which means ignore step 5 on the wiki.
  2. There are music_v1_2 and MusicShieldNewSDLib in your libraries at the same time, which caused the error. Please choose the one you’d like to use, remove the other.
  3. Open the Arduino 1.0 IDE, choose the sketch kept, and run.

Hope this solve your problem.


Awesome, thanks Steve!