I am using crypto++ in my code. I don’t want to use its dependencies so i’ve tried to import crypto++ files in my folder and include them in my .cpp file
I have the followng errors:
TEST.cpp:(.text+0x89a0): undefined reference to `EVP_CIPHER_CTX_init'
TEST.cpp:(.text+0x8cb0): undefined reference to `EVP_aes_128_cbc'
TEST.cpp:(.text+0x8cdd): undefined reference to `EVP_CipherInit_ex'
TEST.cpp:(.text+0x8d49): undefined reference to `EVP_CipherUpdate'
TEST.cpp:(.text+0x8dd6): undefined reference to `EVP_CipherFinal_ex'
TEST.cpp:(.text+0x922d): undefined reference to `EVP_CIPHER_CTX_cleanup'
what am i missing? need some help. Appreciate!
I am working in ubuntu.
You need to do two things, of which you’ve only done one so far.
You need to tell your compiler where to find the appropriate declarations. You’ve done this by adding
in your source file. (Depending on how you installed crypto++, you might also need to tell the compiler where to find
"evp.h", probably using-Isome_directory.)The step you’re missing is telling the linker where to find the actual implementation (the compiled code) of the functions you’re using. According to the
Readme.txtfile included in the distribution, bulding crypto++ creates a library file calledlibcryptopp.a.So something like this should do the job:
Depending on how and where you installed it, you might also need to specify
-Lsome_directoryto tell the linker where to findlibcryptopp.a. (Thegcccommand invokes both the compiler and the linker. The-loption tells the linker to uselibcryptopp.a. The-Loption, if needed, tells it what directory to look in.)