"LMS303:: vector is not a template" error

When I attempt to compile either of the two example codes (Calibrate or Heading) for the the LMS303 sensor, I get the following error.

‘LSM303::vector’ is not a template

from the following line of code,

Any thoughts on a resolution would be beneficial.

~ rich bankhead

Hello, Rich.

I am sorry you are having trouble using the example code. It seems like there is a mismatch between your example version and your LSM303 library version. Did you install the library according the directions under the Getting Started section of the LSM303 GitHub page? Are you accessing the example codes through Arduino’s File -> Examples menu?


I re-installed Arduino and the libraries and it compiles correctly now.

Does it make any difference where you add additional libraries?

C:\Program Files (x86)\Arduino\libraries


C:\Users\rbankhead\Documents\Arduino\libraries (using this is your specified location under preferences)

I have been using the first without issue. I understand that they show up in different locations under the Arduino IDE.

Thank you for the response.

It should not matter where you store your Arduino folder, but when you want to add additional libraries, you should add them to the folder that has the IDE executable you are running.


Another engineer here pointed out to me that I might have misunderstood your question. It is possible your previous problem was from conflicting versions of the library installed in both locations. You should try to be consistent and stick to a single location; I recommend using the \Documents\ path.