nooper
V2EX  ›  问与答

swig 有谁懂吗

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

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