SWIG:SWIG的简介、安装、使用方法之详细攻略
SWIG的简介、安装、使用方法之详细攻略
目录
SWIG的简介
SWIG的安装
SWIG的使用方法
SWIG的简介
SWIG是一种软件开发工具,它将C和C++编写的程序与各种高级编程语言连接起来。SWIG用于不同类型的目标语言,包括常见的脚本语言,如Javascript、Perl、PHP、Python、Tcl和Ruby。支持的语言列表还包括非脚本语言,如C#,D,Go language,Java,包括Android,Lua,OCaml,Octave,Scilab和R。还支持几种解释和编译的Scheme实现(Guile,MzScheme/Racket)。
SWIG最常用于创建高级解释或编译的编程环境、用户界面,以及作为测试和原型化C/C++软件的工具。SWIG通常用于解析C/C++接口,并生成用于上述目标语言调用C/C++代码所需的“胶粘代码”。SWIG还可以XML格式导出解析树。SWIG是自由软件,SWIG生成的代码与商业和非商业项目都兼容。
SWIG官网:http://www.swig.org/
SWIG的安装
下载地址:https://sourceforge.net/projects/swig/files/swig/swig-4.0.1/swig-4.0.1.tar.gz/download?use_mirror=nchc
注:切记,下载的时候要选择对应的系统,比如博主选择的是Win10系统对应的swigwin-4.0.1压缩包。
安装教程:
SWIG的使用方法
C:\Users>swig -help
Supported Target Language Options-csharp - Generate C# wrappers-d - Generate D wrappers-go - Generate Go wrappers-guile - Generate Guile wrappers-java - Generate Java wrappers-javascript - Generate Javascript wrappers-lua - Generate Lua wrappers-octave - Generate Octave wrappers-perl5 - Generate Perl 5 wrappers-php7 - Generate PHP 7 wrappers-python - Generate Python wrappers-r - Generate R (aka GNU S) wrappers-ruby - Generate Ruby wrappers-scilab - Generate Scilab wrappers-tcl8 - Generate Tcl 8 wrappers-xml - Generate XML wrappersExperimental Target Language Options-mzscheme - Generate MzScheme/Racket wrappers-ocaml - Generate OCaml wrappersGeneral Options-addextern - Add extra extern declarations-c++ - Enable C++ processing-co <file> - Check <file> out of the SWIG library-copyctor - Automatically generate copy constructors wherever possible-cpperraswarn - Treat the preprocessor #error statement as #warning (default)-cppext <ext> - Change file extension of generated C++ files to <ext>(default is cxx)-copyright - Display copyright notices-debug-classes - Display information about the classes found in the interface-debug-module <n>- Display module parse tree at stages 1-4, <n> is a csv list of stages-debug-symtabs - Display symbol tables information-debug-symbols - Display target language symbols in the symbol tables-debug-csymbols - Display C symbols in the symbol tables-debug-lsymbols - Display target language layer symbols-debug-tags - Display information about the tags found in the interface-debug-template - Display information for debugging templates-debug-top <n> - Display entire parse tree at stages 1-4, <n> is a csv list of stages-debug-typedef - Display information about the types and typedefs in the interface-debug-typemap - Display typemap debugging information-debug-tmsearch - Display typemap search debugging information-debug-tmused - Display typemaps used debugging information-directors - Turn on director mode for all the classes, mainly for testing-dirprot - Turn on wrapping of protected members for director classes (default)-D<symbol> - Define a symbol <symbol> (for conditional compilation)-E - Preprocess only, does not generate wrapper code-external-runtime [file] - Export the SWIG runtime stack-fakeversion <v>- Make SWIG fake the program version number to <v>-fcompact - Compile in compact mode-features <list>- Set global features, where <list> is a comma separated list offeatures, eg -features directors,autodoc=1If no explicit value is given to the feature, a default of 1 is used-fastdispatch - Enable fast dispatch mode to produce faster overload dispatcher code-Fmicrosoft - Display error/warning messages in Microsoft format-Fstandard - Display error/warning messages in commonly used format-fvirtual - Compile in virtual elimination mode-help - Display help-I- - Don't search the current directory-I<dir> - Look for SWIG files in directory <dir>-ignoremissing - Ignore missing include files-importall - Follow all #include statements as imports-includeall - Follow all #include statements-l<ifile> - Include SWIG library file <ifile>-macroerrors - Report errors inside macros-makedefault - Create default constructors/destructors (the default)-M - List all dependencies-MD - Is equivalent to `-M -MF <file>', except `-E' is not implied-MF <file> - Generate dependencies into <file> and continue generating wrappers-MM - List dependencies, but omit files in SWIG library-MMD - Like `-MD', but omit files in SWIG library-module <name> - Set module name to <name>-MP - Generate phony targets for all dependencies-MT <target> - Set the target of the rule emitted by dependency generation-nocontract - Turn off contract checking-nocpperraswarn - Do not treat the preprocessor #error statement as #warning-nodefault - Do not generate default constructors nor default destructors-nodefaultctor - Do not generate implicit default constructors-nodefaultdtor - Do not generate implicit default destructors-nodirprot - Do not wrap director protected members-noexcept - Do not wrap exception specifiers-nofastdispatch - Disable fast dispatch mode (default)-nopreprocess - Skip the preprocessor step-notemplatereduce - Disable reduction of the typedefs in templates-O - Enable the optimization options:-fastdispatch -fvirtual-o <outfile> - Set name of C/C++ output file to <outfile>-oh <headfile> - Set name of C++ output header file for directors to <headfile>-outcurrentdir - Set default output dir to current dir instead of input file's path-outdir <dir> - Set language specific files output directory to <dir>-pcreversion - Display PCRE version information-small - Compile in virtual elimination and compact mode-swiglib - Report location of SWIG library and exit-templatereduce - Reduce all the typedefs in templates-v - Run in verbose mode-version - Display SWIG version number-Wall - Remove all warning suppression, also implies -Wextra-Wallkw - Enable keyword warnings for all the supported languages-Werror - Treat warnings as errors-Wextra - Adds the following additional warnings: 202,309,403,405,512,321,322-w<list> - Suppress/add warning messages, eg -w401,+321 - see Warnings.html-xmlout <file> - Write XML version of the parse tree to <file> after normal processingOptions can also be defined using the SWIG_FEATURES environment variable, for example:$ SWIG_FEATURES="-Wall"$ export SWIG_FEATURES$ swig -python interface.iis equivalent to:$ swig -Wall -python interface.iArguments may also be passed in a file, separated by whitespace. For example:$ echo "-Wall -python interface.i" > args.txt$ swig @args.txtNote: 'swig -<lang> -help' displays options for a specific target language.
SWIG:SWIG的简介、安装、使用方法之详细攻略相关推荐
- Python语言学习:Python常用自带库(imageio、pickle)简介、使用方法之详细攻略
Python语言学习:Python常用自带库(imageio.pickle)简介.使用方法之详细攻略 目录 imageio简介及其常见使用方法 pickle简介及其常见使用方法 简介 使用方法 简介及 ...
- Computer:互联网开放平台项目知识补充之开发-运维-网络-网关等术语(DMZ、负载均衡、F5、Nginx、容器)的简介、使用方法之详细攻略
Computer:互联网开放平台项目知识补充之开发-运维-网络-网关等术语(DMZ.负载均衡.F5.Nginx.容器)的简介.使用方法之详细攻略 目录 DMZ(隔离区)的简介及其使用方法 1.DMZ区 ...
- Python编程语言学习:包导入和模块搜索路径简介、使用方法之详细攻略
Python编程语言学习:包导入和模块搜索路径简介.使用方法之详细攻略 目录 包导入和模块搜索路径简介 1.Pyhon搜索模块路径的机制 2.自定义配置搜索路径
- Python之 sklearn:sklearn.preprocessing中的StandardScaler函数的简介及使用方法之详细攻略
Python之 sklearn:sklearn.preprocessing中的StandardScaler函数的简介及使用方法之详细攻略 目录 sklearn.preprocessing中的Stand ...
- Py之matplotlib.pyplot:matplotlib.pyplot的plt.legend函数的简介、使用方法之详细攻略
Py之matplotlib.pyplot:matplotlib.pyplot的plt.legend函数的简介.使用方法之详细攻略 目录 matplotlib.pyplot的plt.legend函数的简 ...
- Python之 sklearn:sklearn中的train_test_split函数的简介及使用方法之详细攻略
Python之 sklearn:sklearn中的train_test_split函数的简介及使用方法之详细攻略 目录 sklearn中的train_test_split函数的简介 train_tes ...
- Python之 sklearn:sklearn中的RobustScaler 函数的简介及使用方法之详细攻略
Python之 sklearn:sklearn中的RobustScaler 函数的简介及使用方法之详细攻略 目录 sklearn中的RobustScaler 函数的简介及使用方法 sklearn中的R ...
- BigData之Hive beeline:beeline的简介、使用方法之详细攻略
BigData之Hive beeline:beeline的简介.使用方法之详细攻略 目录 beeline的简介 beeline的使用方法 1.命令行参数解释 2.beeline的输出格式 2.1.ta ...
- ML之sklearn:sklearn.linear_mode中的LogisticRegression函数的简介、使用方法之详细攻略
ML之sklearn:sklearn.linear_mode中的LogisticRegression函数的简介.使用方法之详细攻略 目录 sklearn.linear_mode中的LogisticRe ...
- Python:numpy库中的一些函数简介、使用方法之详细攻略
Python:numpy库中的一些函数简介.使用方法之详细攻略 目录 numpy库中的一些函数简介.使用方法 1.np.concatenate() 1.1.函数案例 1.2.函数用法 numpy库中的 ...
最新文章
- 跳石头 NOIP2015 提高组 Day2 T1
- html 子框架刷新,webpack 热更新 只对改变 CSS 有效 改变 HTML 页面会刷新 没用其他框架。...
- IBM沃森为存储系统开发人员带来的启发
- nginx php 不能连接mysql_nginx配置php环境,并测试PHP是否可以连接mysql
- Intellij IDEA创建的Web项目配置Tomcat并启动Maven项目
- Mysql中的转义字符
- XStream 初探,很给力
- 未来5-10年计算机视觉发展趋势,RACV2019观点集锦
- 谷粒学院笔记day01
- ie11兼容性问题,jsp在IE11显示不全问题,ie11覆盖内容问题解决方法
- c语言自行车租赁系统,winform 自行车租赁系统(含数据库)
- 实数系的基本定理_11、实数的连续性(1)
- Azkaban学习_Azkaban(阿兹卡班)介绍 + Azkaban 安装部署 + Azkaban 实战
- android手机存储空间猛增,实测安卓升级到鸿蒙,可用内存增加半个G,存储空间增加6个G...
- Git 命令使用体验的神器 -- tig
- 学生党专用计算机,学生党平价笔记本电脑 最适合学生的高性价比电脑推荐
- 26.编辑距离(一)
- OA系统中如何实现合同管理?
- 输入一行字符,以回车符作为输入结束的标志。统计其中英文字母、数字字符和其他字符的个数。
- H3C无线控制器双链路备份配置
热门文章
- Debian 9/10快速开启Google BBR的方法,实现TCP高效单边加速
- lua 区间比较_Lua(模糊查找):判断两个字符串(含中文)是否存在至少一个相同
- 小程序 实名信息_【小程序】实名认证流程
- android 安装步骤
- 飞思卡尔烧写工具mfgtools的使用
- 全网实时热备inotify+rsync
- ldap添加自定义字段
- (转)RabbitMQ学习之spring整合发送异步消息(注解实现)
- centOS7 Minima无法上网解决方案(Linux设置开机自动获取ip地址)
- Redis之父退出开源项目维护:人生苦短不想上班