V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
webashe11
V2EX  ›  Swift

求问贴,如果在 swiftUI 中接入 MySQL C client

  •  
  •   webashe11 · Jun 3, 2025 · 3368 views
    This topic created in 337 days ago, the information mentioned may be changed or developed.
    如题

    1. arm 、intel 如何做系统区分
    2. 一定需要本地 brew install mysql 么
    Supplement 1  ·  Jun 4, 2025
    可付费咨询下
    5 replies    2025-06-04 08:35:25 +08:00
    MacsedProtoss
        1
    MacsedProtoss  
       Jun 3, 2025 via iPhone
    蛤?你在说啥玩意 ??
    1.如果是纯 c ,swift 可以直接调用
    2.如果是 cpp ,会麻烦一点,印象里 swift 后来好像有支持计划,不过目前估计得用 oc ( oc++)来包装一层
    3.做啥系统区分?你源码编译一下出个 universal 不就行了
    4.brew install ? what are U doing ? hello ???
    webashe11
        2
    webashe11  
    OP
       Jun 3, 2025
    @MacsedProtoss 自己的写的 C demo 确实可以直接调用,但是在接入 mysql-connector-c 的时候出现了错误
    1. 下载 https://anaconda.org/anaconda/mysql-connector-c/files?version=6.1.11 到项目里
    2. 启动的时候提示 dyld[29115]: Library not loaded: @rpath/libmysqlclient.18.dylib ,我看有些资料是提供本地 brew 安装位置
    XiaoXiaoMagician
        3
    XiaoXiaoMagician  
       Jun 3, 2025
    肯定不是用电脑本地路径的啊,需要用工程那配置 libsqlite3.tbd 动态库。
    webashe11
        4
    webashe11  
    OP
       Jun 3, 2025
    @XiaoXiaoMagician 刚入门,我用 GPT 解决 Library not loaded: @rpath/libmysqlclient.18.dylib ,全部是 brew install mysql
    yarshure
        5
    yarshure  
       Jun 4, 2025
    @webashe11 这样还是只能本地自己用,如果发布还是需要打包进去
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5328 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 44ms · UTC 01:10 · PVG 09:10 · LAX 18:10 · JFK 21:10
    ♥ Do have faith in what you're doing.