Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dvhx opened this issue Jul 7, 2022 · 0 comments
Open

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

dvhx opened this issue Jul 7, 2022 · 0 comments

Comments

@dvhx
Copy link

dvhx commented Jul 7, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant