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

Print.h和Printable.h报错 #11

Closed
kehale opened this issue Mar 29, 2020 · 7 comments
Closed

Print.h和Printable.h报错 #11

kehale opened this issue Mar 29, 2020 · 7 comments

Comments

@kehale
Copy link

kehale commented Mar 29, 2020

我在使用其他.c文件加载#include "FileGroup.h",这个FileGroup.h前面有×,无法build,显示..\ArduinoAPI\Printable.h(25): error: #20: identifier "class" is undefined,..\ArduinoAPI\Print.h(101): error: #169: expected a declaration。我是初学者,在这麻烦你解决下,谢谢,最近下载的文件,是最新的。使用main.cpp,build是没有问题的,就是其他的.c文件加头文件include "FileGroup.h"build出错

@FASTSHIFT
Copy link
Owner

@kehale
identifier "class" is undefined 说明没有用C++编译器
您用的是什么版本的keil

@kehale
Copy link
Author

kehale commented Mar 29, 2020

5.14

@FASTSHIFT
Copy link
Owner

关于"FileGroup.h"前面的x号,可以尝试 Options for target->C/C++->Misc Controls 里的"--gnu"去除

@FASTSHIFT
Copy link
Owner

可能是keil版本导致的,建议换5.25版本,我编译没问题。

@kehale
Copy link
Author

kehale commented Mar 29, 2020

嗯。谢谢了

@FASTSHIFT
Copy link
Owner

另外,.c里不能直接调用C++,不能引用C++的头文件,您需要把.c文件的扩展名改为.cpp

@kehale
Copy link
Author

kehale commented Mar 29, 2020

谢谢了 是c++的问题的解决了

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