如何使用加密++库在KDevelop的建设项目 [英] How to build a project using Crypto++ library in kdevelop

查看:175
本文介绍了如何使用加密++库在KDevelop的建设项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了使用加密++的小程序库使用 KDevelop的 Ubuntu的。我正确地得到输出,当我使用 -lcryptopp 从终端编译。我想从 KDevelop的构建和执行使用 cmake的程序本身。我怎样才能包括 CRYPTOPP_DIR CMake的配置这样做的。

I wrote a small program that uses the crypto++library using kdevelop in Ubuntu. I get the output correctly when I compile it from the terminal using -lcryptopp. I would like to build and execute the program using the cmake from kdevelop itself. How can I include the CRYPTOPP_DIR in the cmake configuration for doing this.

任何帮助将AP preciated。三江源。

Any help will be appreciated. Thankyou.

推荐答案

添加下面的一段code到CMake的文件帮助我:

Adding the following piece of code to cmake file helped me:

FIND_LIBRARY(CRYPTOPP crypto++ /usr/lib) ## location of libcryptopp.so or libcryptopp.a
IF ( CRYPTOPP )
TARGET_LINK_LIBRARIES(${PROGRAM_NAME} cryptopp ) ## Specifying cryptopp in uppercase gave me link error.
ENDIF( CRYPTOPP )

如果 pthread库是必要的,也是在cmake的文件中添加它。
这为我工作。得到 https://forum.anope.org

If pthread library is needed, also add it in the cmake file. This worked for me. Got the solution from https://forum.anope.org

这篇关于如何使用加密++库在KDevelop的建设项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆