简体   繁体   English

GMP库:我们是否可以仅使用一种功能gmp_printf而不构建完整的GMP库?

[英]GMP Lib : Can we use only one functionality say gmp_printf without Building Complete GMP lib?

I am just starting with GMP for that I need to check any one function. 我只是从GMP开始,我需要检查任何一项功能。

I downloaded gmp-6.0.tar , extracted it then I used gmp_printf in my code . 我下载了gmp-6.0.targmp-6.0.tar压缩,然后在代码中使用了gmp_printf

Now when I open gmp_printf.c it has a header file gmp.h . 现在,当我打开gmp_printf.c它具有头文件gmp.h But when I search into that extracted folder its not there. 但是,当我搜索到该提取的文件夹时,它不存在。 So I just want that printf.c code to be linked with my native code successfully. 因此,我只希望将printf.c代码与本机代码成功链接。

And I don't want complete library to be installed. 而且我不希望安装完整的库。

The header gmp.h is generated when you run configure and contains specific information on what settings you configure with. 标题gmp.h是在运行configure时生成的,并且包含有关使用哪些设置进行配置的特定信息。 In general it is not a good idea to cut a function from its library. 通常,从其库中剪切功能不是一个好主意。 Especially in this case, I cannot see any way you can print GMP types without actually having them defined. 特别是在这种情况下,如果没有实际定义它们,我将看不到任何可以打印GMP类型的方法。

Also note that GMP is LGPLv3 and/or GPL v2.0 and by copying code like this your code must be GPL compatible. 还要注意,GMP是LGPLv3和/或GPL v2.0,并且通过复制这样的代码,您的代码必须与GPL兼容。

Have a look at mini-gmp. 看看mini-gmp。 It is included in the GMP source as a stand alone, portable SUBSET GMP library. 它作为独立的便携式SUBSET GMP库包含在GMP源代码中。 :) :)

See this mail list thread as reference: https://gmplib.org/list-archives/gmp-devel/2011-December/002144.html 请参阅此邮件列表线程作为参考: https : //gmplib.org/list-archives/gmp-devel/2011-December/002144.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM