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 on c++ #1

Open
FrederikVagner opened this issue Nov 11, 2013 · 1 comment
Open

Compilation on c++ #1

FrederikVagner opened this issue Nov 11, 2013 · 1 comment

Comments

@FrederikVagner
Copy link

Sorry to border you here, while you lib works amazingly well, it has a small compilation problem if you compile on a c++ code/compiler. May a suggest to warp the function signatures around a:

ifdef __cplusplus

extern "C" {

endif

.
.
.

ifdef __cplusplus

}

endif

Except for that, your library is perfect and really solved my serial communication problems with Arduino, so thank you for that.

PS: without the extern "C", the code will not compile/link, but the proposed solution removes all the problems

@adamryczkowski
Copy link

I don't think it is necessary. Just include the headers in your main.hpp like that:

extern "C" {
    #include "arduino-serial-lib.h"
}

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

2 participants