I want to call C library "mysql.h" from Rust language

I'm trying to connect to mysql from rust code. I've tried these steps.
    1. I wrote c code using mysql.h, and command below.
    
     $ gcc -shared mysqlrust.c -o libmysqlrust.so  $(mysql_config --cflags) $(mysql_config --libs)   $(mysql_config --cflags)
     $ cp libmysqlrust.so /usr/local/lib/rustc/i686-unknown-linux-gnu/lib/
    
    2. I wrote Rust code, that calls libmysqlrust.so.
But I couldn't figure out way to use C type structure "`MYSQL`", "`MYSQL_RES`", "`MYSQL_ROW`". Please show me how to use c type structure from rust code.
Let's see the code you have written and the exact error messages

以上就是I want to call C library "mysql.h" from Rust language的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » CSS3 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏