简体   繁体   English

在Linux中将Crypto ++代码集成到Qt应用程序

[英]Integrate Crypto++ code to Qt Application In Linux

I try to use this example code of using AES algorithm. 我尝试使用这个使用AES算法的示例代码。 I am new to qt and linux and try to figure out how should I use this library. 我是qt和linux的新手,并尝试弄清楚如何使用该库。

I downloaded the file Crypto++ 5.0 from here and unzip it . 我从这里下载文件Crypto ++ 5.0并解压缩。 Now I have direcory in ~/Downloads/crypto with many cpp and header files but I dont know what's next. 现在我在〜/ Downloads / crypto中有很多cpp和头文件,但是我不知道下一步是什么。 which file should I compile? 我应该编译哪个文件? how can I integrate this to small Qt project? 如何将其集成到小型Qt项目中? If I copy the code from the link , the compiler cant find all the include files (which is make sense). 如果我从链接中复制代码,则编译器无法找到所有包含文件(这是有道理的)。 so what i need to do to run this small example? 那么我需要做些什么来运行这个小例子?

I use Qt 5.4.1, th compiler is g++ 我使用的是Qt 5.4.1,编译器是g ++

I found the blog describing Crypto++, Qt and Linux: 我找到了描述Crypto ++,Qt和Linux的博客:

https://inphamousdevelopment.wordpress.com/2011/05/06/crypto-and-linux/ https://inphamousdevelopment.wordpress.com/2011/05/06/crypto-and-linux/

The main idea is that you should not using downloaded files but use terminal: 主要思想是您不应使用下载的文件,而应使用终端:

sudo apt-get install libcrypto++8 libcrypto++8-dbg libcrypto++-dev

To add library to the project use the following: 要将库添加到项目中,请使用以下命令:

LIBS += -L/usr/lib/crypto++ -lcrypto++
INCS += -I/usr/include/crypto++

See the first link for more details, hope it helps. 请参阅第一个链接以获取更多详细信息,希望对您有所帮助。

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

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