[SOLVED] Compile Error with UbidotsSaveValue Example on YUN when using Bridge

Hi All,

the UbidotsSaveValue Example from the UbidotsYUN library works fine as it is.
As soon as I include the Bridge library I get the following compile errors:

C:\Temp\cc3wJTrW.ltrans0.ltrans.o: In function Ubidots::sendAll() [clone .constprop.12]': cc3wJTrW.ltrans0.o:(.text+0x638): undefined reference to vtable for Process’
cc3wJTrW.ltrans0.o:(.text+0x63a): undefined reference to vtable for Process' cc3wJTrW.ltrans0.o:(.text+0x648): undefined reference to Bridge’
cc3wJTrW.ltrans0.o:(.text+0x64a): undefined reference to Bridge' cc3wJTrW.ltrans0.o:(.text+0xa3c): undefined reference to Process::runShellCommand(String const&)’
cc3wJTrW.ltrans0.o:(.text+0xa64): undefined reference to Process::running()' cc3wJTrW.ltrans0.o:(.text+0xaba): undefined reference to Process::~Process()’
C:\Temp\cc3wJTrW.ltrans0.ltrans.o: In function main': cc3wJTrW.ltrans0.o:(.text.startup+0x1d4): undefined reference to Bridge’
cc3wJTrW.ltrans0.o:(.text.startup+0x1d8): undefined reference to Bridge' cc3wJTrW.ltrans0.o:(.text.startup+0x224): undefined reference to Bridge’
cc3wJTrW.ltrans0.o:(.text.startup+0x226): undefined reference to Bridge' cc3wJTrW.ltrans0.o:(.text.startup+0x228): undefined reference to BridgeClass::begin()’
collect2.exe: error: ld returned 1 exit status


Device: Arduino Yun
IDE: 1.6.12 from arduino.cc on Win10

Code:
#include <Bridge.h>
#include <UbidotsYUN.h>
#define TOKEN “MY_TOKEN_HERE”

Ubidots client(TOKEN);

void setup() {
client.init();
Serial.begin(9600);
}

void loop() {
float value = analogRead(A0);
client.add(“Variable_Name”, value);
client.sendAll();
}


Any idea anybody?

Many thanks in advance,
Stefan

Hi @stefan,

We can’t replicate the error. Here’s the code that i tested

#include <UbidotsYUN.h>
#define TOKEN "YOUR_TOKEN_HERE"
#include <Process.h>


Ubidots client(TOKEN);

void setup() {
 client.init();
 Serial.begin(9600);
 Bridge.begin();
}

void loop() {
 float value = analogRead(A0);
 client.add("Variable_Name", value);
 client.sendAll(); 
}

Regards

Hi @mariahernandez,

sorry for wasting your time, my code example was incomplete.
The angle brackets around the library names in the include statements make the rest of the line disappear
in this textbox if not using the “preformatted text” option.

#include <Bridge.h> became #include in my code sample above.

So, the #include <Bridge.h> causes the compile error.

Meanwhile I think I got a solution, it seems to be a matter of the order of including the libraries.
This order results in a compile error.

#include <Bridge.h> #include <UbidotsYUN.h>

Include Bridge after UbidotsYUN library and it compiles without error.
#include <UbidotsYUN.h> #include <Bridge.h>

So this one seems to be solved, just wrote it down in case somebody else runs into the same problem.