-
Notifications
You must be signed in to change notification settings - Fork 3
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
能否讲解一下这个工程是怎么创建的 #2
Comments
比如bindings.rs是怎么创建的 |
是通过 libctp-build 这个程序创建的,其实就是将 wrapper.cpp 转换为了 rust代码,保存到了 bindings.rs里 |
auto_bind.rs main.rs需要自己去写,对吗? |
还有就是这个工程和使用cxx,autocxx有什么区别 |
嗯,仓库里都有代码的 |
cxx 只是把原始头文件转换一下,方便 bindgen 转换为 rust 代码 |
问一个问题,bindings.rs中生成的结构体中很多字段都是c风格的字符数组,这些字段如何在输出时被自动检测输出成字符串 |
bindgen生成的代码太底层了,不利于rust写程序,可以结合autocxx,生成更友好的rust接口吗 |
你的意思是用autocxx替代 bindgen? |
我是这么转换的
|
这样的话,我要输出整个结构体,必须对很多字段都要执行这个方法 |
不知道可不可以直接替代,还是先用bindgen生成底层代码,然后对bindings.rs再用autocxx生成更rust友好的代码,具体我也没有研究过 |
昨天试了一下 autocxx,感觉挺麻烦的,头文件路径还没搞定 |
嗯,有的字符串还有中文编码问题,不知道有什么减少内存拷贝的简单方式 |
不好意思,autocxx你还在继续吗? |
最近忙别的呢 |
No description provided.
The text was updated successfully, but these errors were encountered: