Skip to content

Compile error when declaring a pointer-function #2772

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

Closed
happybrick opened this issue Mar 14, 2015 · 2 comments
Closed

Compile error when declaring a pointer-function #2772

happybrick opened this issue Mar 14, 2015 · 2 comments
Assignees
Labels
Component: Preprocessor The Arduino sketch preprocessor converts .ino files into C++ code before compilation

Comments

@happybrick
Copy link

I get a weird compile-error with self-written classes when i declare a function that returns a pointer to that very class. Can't figure out why.
UECIDE 0.8.7z36 compiles the example-code (ardubug.ino) without any errors though.
Using: Windows7-64bit, Arduino-IDE 1.6.1, Arduino Nano, ATmega328 ( Same problem for all other platines / prozessors, too )

--- Arduino-IDE - Error-Output:
ardubug.ino:2:1: error: 'MyClass' does not name a type
Fehler beim Kompilieren.

--- Code:
class MyClass{
public:
MyClass();
int value;
};

MyClass::MyClass(){
this->value = 101;
}

MyClass* someProcedure(){
return NULL;
}
void setup() {}
void loop() {}

@ffissore ffissore added the Component: Preprocessor The Arduino sketch preprocessor converts .ino files into C++ code before compilation label Mar 16, 2015
@ffissore ffissore self-assigned this Mar 16, 2015
@ffissore
Copy link
Contributor

Hi
this is an issue with the current preprocessor. There is an experimental build that fixes your issue: you may want to give it a try. See #2729 (bottom of the page). This build is not perfect, but works with most simple sketches

@happybrick
Copy link
Author

Thx, i will definitly will give it a try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Preprocessor The Arduino sketch preprocessor converts .ino files into C++ code before compilation
Projects
None yet
Development

No branches or pull requests

2 participants