如何使用加密++库在KDevelop的建设项目 [英] How to build a project using Crypto++ library in 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屋!