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

现在的Perfect-MySQL好像不兼容最新的swift #35

Open
xiaote2016 opened this issue Aug 3, 2018 · 12 comments
Open

现在的Perfect-MySQL好像不兼容最新的swift #35

xiaote2016 opened this issue Aug 3, 2018 · 12 comments

Comments

@xiaote2016
Copy link

Perfect-MySQL中的my_bool类型报错,还有MySQL.Swift中的exposedOptionToMySQLOption方法报错

@zhangxiaoyuheshui
Copy link

你好,你解决了吗? 刚看到有人说需要安装5.7.21版本的 mysql, 不知道是不是这样原因。?

@xiaote2016
Copy link
Author

解决了,pull request中有写

@king-roc
Copy link

你好 我按照 pull request 里的修改了 但是 my_bool类型报错还是有啊

@xiaote2016
Copy link
Author

typealias my_bool = CChar 加上这句!

@ListenXunInNight
Copy link

ListenXunInNight commented Dec 3, 2018

现在已经解决,我把我解决的方法公布出来吧,方便大家解决。
【MySQL 版本 8.0.12】【Swift 4.0】
在 mysql.h 头文件中,添加【typedef bool my_bool】
将bool类型相关的值全部进行替换(报错的地方)【将0换成false,1换成true】
还有遇到问题不会解决的,可以发邮件给我:[email protected]

@lbininhbl
Copy link

具体应该怎么做?我尝试了还是不行。是在module.map文件加上那一句之后,然后根据错误提示到每个文件里做修改?

@ListenXunInNight
Copy link

具体应该怎么做?我尝试了还是不行。是在module.map文件加上那一句之后,然后根据错误提示到每个文件里做修改?

是,我就是那么处理的,如果你那样不行,看看你是否还有其他问题

@lbininhbl
Copy link

具体应该怎么做?我尝试了还是不行。是在module.map文件加上那一句之后,然后根据错误提示到每个文件里做修改?

是,我就是那么处理的,如果你那样不行,看看你是否还有其他问题

有一个警告:warning: failed to retrieve search paths with pkg-config; maybe pkg-config is not installed

还有

/Users/admin/Desktop/workflow/Test/PerfectTemplate/.build/checkouts/Perfect-MySQL.git--3177730509280018944/Sources/PerfectMySQL/MySQL.swift:175:11: error: use of unresolved identifier 'MYSQL_OPT_USE_REMOTE_CONNECTION'
return MYSQL_OPT_USE_REMOTE_CONNECTION
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/admin/Desktop/workflow/Test/PerfectTemplate/.build/checkouts/Perfect-MySQL.git--3177730509280018944/Sources/PerfectMySQL/MySQL.swift:177:11: error: use of unresolved identifier 'MYSQL_OPT_USE_EMBEDDED_CONNECTION'
return MYSQL_OPT_USE_EMBEDDED_CONNECTION
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/admin/Desktop/workflow/Test/PerfectTemplate/.build/checkouts/Perfect-MySQL.git--3177730509280018944/Sources/PerfectMySQL/MySQL.swift:179:11: error: use of unresolved identifier 'MYSQL_OPT_GUESS_CONNECTION'
return MYSQL_OPT_GUESS_CONNECTION
^~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/admin/Desktop/workflow/Test/PerfectTemplate/.build/checkouts/Perfect-MySQL.git--3177730509280018944/Sources/PerfectMySQL/MySQL.swift:181:11: error: use of unresolved identifier 'MYSQL_SET_CLIENT_IP'; did you mean 'MYSQL_SET_CHARSET_DIR'?
return MYSQL_SET_CLIENT_IP
^~~~~~~~~~~~~~~~~~~
MYSQL_SET_CHARSET_DIR
mysqlclient.MYSQL_SET_CHARSET_DIR:1:12: note: 'MYSQL_SET_CHARSET_DIR' declared here
public var MYSQL_SET_CHARSET_DIR: mysql_option { get }
^
/Users/admin/Desktop/workflow/Test/PerfectTemplate/.build/checkouts/Perfect-MySQL.git--3177730509280018944/Sources/PerfectMySQL/MySQL.swift:183:11: error: use of unresolved identifier 'MYSQL_SECURE_AUTH'; did you mean 'MYSQL_DEFAULT_AUTH'?
return MYSQL_SECURE_AUTH
^~~~~~~~~~~~~~~~~
MYSQL_DEFAULT_AUTH
mysqlclient.MYSQL_DEFAULT_AUTH:1:12: note: 'MYSQL_DEFAULT_AUTH' declared here
public var MYSQL_DEFAULT_AUTH: mysql_option { get }
^
/Users/admin/Desktop/workflow/Test/PerfectTemplate/.build/checkouts/Perfect-MySQL.git--3177730509280018944/Sources/PerfectMySQL/MySQL.swift:189:11: error: use of unresolved identifier 'MYSQL_OPT_SSL_VERIFY_SERVER_CERT'; did you mean 'CLIENT_SSL_VERIFY_SERVER_CERT'?
return MYSQL_OPT_SSL_VERIFY_SERVER_CERT
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CLIENT_SSL_VERIFY_SERVER_CERT
mysqlclient.CLIENT_SSL_VERIFY_SERVER_CERT:1:12: note: 'CLIENT_SSL_VERIFY_SERVER_CERT' declared here
public var CLIENT_SSL_VERIFY_SERVER_CERT: UInt { get }

@ListenXunInNight
Copy link

你这是部署在Ubuntu上吧?

@lbininhbl
Copy link

你这是部署在Ubuntu上吧?

没有,就是mac上本地服务

@zhangshunhe
Copy link

问题解决了吗

@zhangshunhe
Copy link

我也遇到了 failed to retrieve search paths with pkg-config; maybe pkg-config is not installed

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

6 participants