Skip to content

Compilation error when including .c file from the same directory #142

Open

Description

@dvhx

I have 3 files in project folder:

  • project.ino
  • lib.h
  • lib.c

Content of lib.h:

#define FOO 123

Content of lib.c:

#include "lib.h"
int foo() {
  return FOO;
}

Content of project.ino:

#include "lib.c"
void setup() {
  // put your setup code here, to run once:
}
void loop() {
  // put your main code here, to run repeatedly:
}

When I try to compile it it ends with error: panic: runtime error: index out of range [2] with length 2

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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