{"id":34919561,"url":"https://github.com/feixiao/swig","last_synced_at":"2025-12-26T13:13:47.373Z","repository":{"id":147562428,"uuid":"190312211","full_name":"feixiao/swig","owner":"feixiao","description":"swig快速入门","archived":false,"fork":false,"pushed_at":"2020-07-08T08:18:33.000Z","size":1046,"stargazers_count":20,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-19T10:08:53.656Z","etag":null,"topics":["cgo","go","swig"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/feixiao.png","metadata":{"files":{"readme":"ReadMe.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-05T02:27:52.000Z","updated_at":"2025-03-27T14:51:43.000Z","dependencies_parsed_at":"2023-04-10T20:58:31.420Z","dependency_job_id":null,"html_url":"https://github.com/feixiao/swig","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/feixiao/swig","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feixiao%2Fswig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feixiao%2Fswig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feixiao%2Fswig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feixiao%2Fswig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/feixiao","download_url":"https://codeload.github.com/feixiao/swig/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feixiao%2Fswig/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28055274,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-26T02:00:06.189Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cgo","go","swig"],"created_at":"2025-12-26T13:13:46.802Z","updated_at":"2025-12-26T13:13:47.360Z","avatar_url":"https://github.com/feixiao.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## SWIG快速入门\n#### 简介\nSWIG是一个软件开发工具，它将用C和c++编写的程序与各种高级编程语言连接起来（为其他需要生成库）。准确地说，SWIG生成了两个文件，一个文件是*_wrapper.cpp文件，一个是*.go文件。*_wrapper.cpp文件将C++接口封装为C接口。go文件通过上一节说的import \"C\"来引用C接口，并把对这些C接口的调用，封装为不涉及任何C特性的Go函数或方法。\n+ [项目地址](https://github.com/swig/swig)\n+ [项目自带Examples](https://github.com/swig/swig/tree/master/Examples)\n+ [文档](http://www.swig.org/Doc3.0/Contents.html#Contents)\n\n#### SWIG安装\n+ Mac/Ubuntu\n```shell\nsudo apt-get install bison \n\nunzip swig-rel-3.0.12.zip\ncd   swig-rel-3.0.12\n./autogen.sh  \u0026\u0026 ./configure\nmake -j 4 \u0026\u0026 sudo make install\n```\n+ Windows 10\n```shell\n# swig windows版本\nhttps://sourceforge.net/projects/swig/files/swigwin\n# 解压然后添加环境变量即可\nwindows不支持cgo,所以此路不通\n```\n\n\n#### 参考资料\n+ [《go通过swig封装、调用c++共享库的技术总结》](https://www.cnblogs.com/terencezhou/p/10059156.html)\n+ [《使用swig工具为go语言与c++进行交互》](https://www.cnblogs.com/dongc/p/6896850.html)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffeixiao%2Fswig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffeixiao%2Fswig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffeixiao%2Fswig/lists"}