Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.
This repository was archived by the owner on Mar 17, 2025. It is now read-only.

Firebase with Arduino IDE makes function definitions in .ino order dependant #68

@danielcrowley

Description

@danielcrowley

This issue was hidden away in a larger project but I've managed to simplify it down to a very basic definition of a function in the .ino.
This is happening in the Ardunino IDE, but works fine with Visual Micro.

//#include <Firebase.h>

void setup() {

  test();
}

void loop() {
}

void test(){
  Serial.println("woo");
}

This complies, but if you uncomment the #include, and it says test() hasn't been declared

C:\Users\Daniel\AppData\Local\Temp\arduino_0c4b0ad3e77c4cee76cbe62faa3f08cf\FirebasePush_ESP8266.ino: In function 'void setup()':

FirebasePush_ESP8266:5: error: 'test' was not declared in this scope

   test();

        ^

exit status 1
'test' was not declared in this scope

But moving test() definition to the top of the file it works again.

#include <Firebase.h>

void test(){
  Serial.println("woo");
}


void setup() {

  test();
}

void loop() {
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions