Bridge Library of Arduino Yun compilation problems

I recently installed on Atom PlatformIO and after having opportunely created a new project for arduino Yun I decided to try to compile an example of the Bridge library but immediately an error appears.

src\main.cpp:87:23: error: ‘modeCommand’ was not declared in this scope

*** [.pioenvs\yun\src\main.cpp.o] Error 1
[ERROR] Took 0.92 seconds

Without the inclusion of the code in your post, it’s hard to tell exactly what is happening. However, it is most likely that the function declarations/function prototypes are missing, because the code example you are using is meant for the Arduino IDE and the pre-processor they use. i.e. Like in this example code, where modeCommand() is defined around line 151, but there is no function declaration up the top of the file because the Arduino Builder pre-processor will generate it automatically.

You could either:

  1. Ensure that functions are declared before you use them
  2. Move the setup() and loop() functions to the bottom of the file… so that all the other functions are defined/implemented BEFORE they are called in setup() or loop().

To learn more, have a look at the Declaring Functions here. Also, have a look at the PlatformIO FAQ documentation on converting Arduino files to C++ files.

1 Like

Thank You so much Peter.
thanks to your help I solved the problem.:smiley:

1 Like