如何把代码复制到codeblocks里_Windows 10/8/7 - CodeBlocks 安装 和 编译 NTL

57aa83d7567688ac2e018c7ecbf32762.png

NTL 介绍

NTL is a high-performance, portable C++ library providing data structures and algorithms for manipulating signed, arbitrary length integers, and for vectors, matrices, and polynomials over the integers and over finite fields.

步骤

1.在 https://www.shoup.net/ntl/ 下载 WinNTL-11_4_3.zip , 并解压到 任意目录 (目录不要有中文和空格,以下也是)

2.将WinNTL-11_4_3中include文件夹下的文件复制到codeblocks安装目录/MinGw/include

3.打开codeblocks 新建一个 static library 项目 项目名字lib(名字随意)

c58d104a02ace81717265556c74aeb08.png

右键lib项目,Add files(添加文件),添加 WinNTL-11_4_3解压目录/src 文件夹下所有文件

27c8817141512871d087c35a3fd0772b.png

点击打开,成功后如图所示

d8d1a7a7060d78fecf7545e0e5fd0004.png

点击 Settings/Compiler/Search directories

添加 WinNTL-11_4_3解压目录include 目录

3a8cc5d4cf28a0f415afb4007b27cfd7.png

编译项目

7022594edd5881d5f7ffb88dd056a24e.png

等待编译完成后, Settings/Compiler/Linker settings ,点击Add , 从 项目路径libbinDebug 中添加 lib.a 文件

b7338fa3b2e715ca3a0f04ebaf30cf0d.png

至此NTL已经配置好了!

测试

新建项目 选择控制台应用程序

3d54d5751ee113c3a53c3e07289d7e63.png

在 A Tour of NTL: Examples 中, 有很多NTL的样例

比如我们选择Big Integers 来测试下

468b1461e627563a80ad440c5180d473.png

复制代码到codeblocks中, 编译运行,随便敲两个大数,看到程序很快就给出了结果

0bb355556f394aa907bb6f9b293dca77.png

首发于

Laphel​blog.laphel.com
8daf20860719af6b9220599ac25b8faf.png
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值