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

引入报错 #67

Closed
669754618 opened this issue Jun 22, 2017 · 9 comments
Closed

引入报错 #67

669754618 opened this issue Jun 22, 2017 · 9 comments
Labels

Comments

@669754618
Copy link

我实用 cocoapods 添加了 WCDB 在导入 头文件<WCDB/WCDB.h> ,修改了.mm 之后编译出错: 在pragma.hpp 文件 第68行 错误为:Expected member name or ';' after declaration specifiers

@RingoD
Copy link
Collaborator

RingoD commented Jun 22, 2017

这个没道理呀。还有没有其他错误?
另外看一下本地的WCDB代码是否有误修改。

@669754618
Copy link
Author

@RingoD 没有任何修改 但是指定版本了 pod 'WCDB' ,'~>1.0.0' 你看有没有影响呢

@RingoD
Copy link
Collaborator

RingoD commented Jun 22, 2017

应该是没有影响的。也可以尝试下用1.0.1版本

能否贴一些完整的编译错误?

@669754618
Copy link
Author

2017-06-22 4 46 38

@669754618
Copy link
Author

@RingoD

@RingoD
Copy link
Collaborator

RingoD commented Jun 22, 2017

看样子你是在某个地方定义了一个PageSize的宏,导致代码被替换了

@669754618
Copy link
Author

@RingoD 谢谢,就是这个问题,但是你们也应该把名字改改把。太容易重复了 WC_PageSize 挺好的

@RingoD
Copy link
Collaborator

RingoD commented Jun 22, 2017

WCDB的PageSize是类内的一个变量名,使用上并无不规范,也没有变量名前需要加前缀的代码习惯。

倒是PageSize的宏:宏是全局的字符串替换,应该尽量避免在头文件中使用。如果必须在头文件使用,需加上适当的前缀确保宏名唯一。习惯上,宏名用全大写的字母比较好。

参考:https://google.github.io/styleguide/cppguide.html#Preprocessor_Macros

@669754618
Copy link
Author

2017-06-22 5 40 17

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

No branches or pull requests

2 participants