nooper
V2EX  ›  问与答

swig 有谁懂吗

  •  
  •   nooper · Jul 13, 2014 · 3317 views
    This topic created in 4499 days ago, the information mentioned may be changed or developed.
    我有*.so 文件和 *.h 文件。 没有C++源代码。
    如何才能够进行封装。
    3 replies  •  2014-07-13 16:08:25 +08:00
    ksword
    ksword
    Jul 13, 2014
    1
    你用cgo指令在代码中指定加载so文件,再写个*.swigcxx的接口文件就可以了,go build会自动调用swig程序生成相关文件并编译

    可以参考这个slide:
    http://akrennmair.github.io/golang-cgo-slides/
    nooper
    nooper
    OP
    Jul 13, 2014
    2
    @ksword 根本就没看懂啊,go我不懂。我希望能够提供一个众多语言的封装。
    ksword
    ksword
    Jul 13, 2014
    3
    @nooper 不好意思,我还以为是go的。。。其他语言的你可以看下swig的官方文档
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4661 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 09:06 · PVG 17:06 · LAX 01:06 · JFK 04:06
    ♥ Do have faith in what you're doing.