LSM303 - fatal error:vector: no such file or directory - ard

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
rallentando
 
Posts: 4
Joined: Tue Nov 13, 2018 7:26 am

LSM303 - fatal error:vector: no such file or directory - ard

Post by rallentando »

Hi, I have purchased a LSM303 Accelerometer but cannot get the sample code to compile on the Arduino Web Editor.
In order to isolate the flat I have reduce the code as follows:

Code: Select all

#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_LSM303_U.h>
void setup(void)
{}
void loop(void)
{}
When I try to compile I get the following errors:

Code: Select all

./opt/arduino-builder/arduino-builder -compile -core-api-version 10611 -hardware opt/arduino-builder/hardware -hardware ./opt/cores -tools opt/arduino-builder/tools -tools ./opt/tools -built-in-libraries opt/libraries/latest -logger humantags -fqbn arduino:avr:nano:cpu=atmega328old -build-cache /tmp -build-path /tmp/972076145/build -verbose -prefs runtime.tools.avr-gcc.path=./opt/tools/avr-gcc/5.4.0-atmel3.6.1-arduino2 -prefs runtime.tools.avrdude.path=./opt/tools/avrdude/6.3.0-arduino14 -prefs runtime.tools.arduinoOTA.path=./opt/tools/arduinoOTA/1.2.1 -libraries /tmp/972076145/custom -libraries /tmp/972076145/pinned /tmp/972076145/magsensor_copy

Multiple libraries were found for "Adafruit_Sensor.h"
Used: /home/ubuntu/opt/libraries/latest/bno055simplepacketcoms_0_0_3
Not used: /home/ubuntu/opt/libraries/latest/adafruit_unified_sensor_1_0_2
Not used: /home/ubuntu/opt/libraries/latest/adafruit_unified_sensor_1_0_2
Not used: /home/ubuntu/opt/libraries/latest/adafruit_unified_sensor_1_0_2
Not used: /home/ubuntu/opt/libraries/latest/adafruit_unified_sensor_1_0_2
Using library adafruit_lsm303dlhc_1_0_3 at version 1.0.3 in folder: /home/ubuntu/opt/libraries/latest/adafruit_lsm303dlhc_1_0_3
Using library simplepacketcoms_0_0_6 at version 0.0.6 in folder: /home/ubuntu/opt/libraries/latest/simplepacketcoms_0_0_6
In file included from /home/ubuntu/opt/libraries/latest/bno055simplepacketcoms_0_0_3/src/GetIMU.h:12:0,
from /home/ubuntu/opt/libraries/latest/bno055simplepacketcoms_0_0_3/src/GetIMU.cpp:8:
/home/ubuntu/opt/libraries/latest/simplepacketcoms_0_0_6/src/SimplePacketComs.h:5:18: fatal error: vector: No such file or directory

compilation terminated.
exit status 1
I get similar errors when attempting to compile the magnetometer example code from the Library.
Can you assist me in how I can select the correct libraries when using the Arduino web editor please?
Last edited by adafruit_support_carter on Tue Nov 13, 2018 7:16 pm, edited 1 time in total.
Reason: added [code] tags

User avatar
adafruit_support_carter
 
Posts: 29056
Joined: Tue Nov 29, 2016 2:45 pm

Re: LSM303 - fatal error:vector: no such file or directory -

Post by adafruit_support_carter »

By web editor, you mean Arduino Create?
https://create.arduino.cc/

User avatar
rallentando
 
Posts: 4
Joined: Tue Nov 13, 2018 7:26 am

Re: LSM303 - fatal error:vector: no such file or directory -

Post by rallentando »

Yes Arduino Create

User avatar
adafruit_support_carter
 
Posts: 29056
Joined: Tue Nov 29, 2016 2:45 pm

Re: LSM303 - fatal error:vector: no such file or directory -

Post by adafruit_support_carter »

OK. I got the same issue. It's basically finding multiple versions of the header file and then picking the wrong one. This can happen when multiple libraries are installed locally, and the solution there is to just delete or modify things so the conflict is gone. But for the web IDE, it's all in the cloud. So that approach won't work.

I got your error by simply pasting your code into a blank session and doing a verify.

But I then got it to work by doing this:
* Click Libraries on the left hand nav to bring up the Library Manager
* Search for "Adafruit Unified Sensor"
* Mouse over the entry in the search result list, a button labeled "INCLUDE" should show up
* Click that button and select latest version

It just adds the same text you already have, but it must also do something behind the scenes to let the cloud compiler know that it should use the Unified Sensor header file over that bno055 one.

User avatar
rallentando
 
Posts: 4
Joined: Tue Nov 13, 2018 7:26 am

Re: LSM303 - fatal error:vector: no such file or directory -

Post by rallentando »

Thanks that sounds interesting. I'll give it a go. I must admit I didn't think of that approach.
I will report on my success or otherwise...

User avatar
rallentando
 
Posts: 4
Joined: Tue Nov 13, 2018 7:26 am

Re: LSM303 - fatal error:vector: no such file or directory -

Post by rallentando »

Fantastic that worked a treat. It is always easy when you know how.
Many thanks for your assistance.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”