Including Cryptopp lib
-
I have compiled cryptopp using mingw on windows 10 and added
INCLUDEPATH
andLIBS
paths in the .pro file like this:INCLUDEPATH += C:\dev\cryptopp700\ LIBS += -LC:\dev\cryptopp700\release\ -llibcryptopp
But when I'm trying to build the project I get
undefined reference
errors. Is there a problem with myINCLUDEPATH
andLIBS
paths? How should I include the Cryptopp libs into my project?I'm only facing this problem in windows. I was able to build my project successfully on macos.
-
Hi and welcome to devnet forum
Replace the backward slashes with forward slashes, remove last slash and try again.
INCLUDEPATH += C:/dev/cryptopp700 LIBS += -LC:/dev/cryptopp700/release -llibcryptopp
Backward slashes are used as end of line for continuation in next line.
-
@dhamith93 please don't forget to mark your post as solved! Thanks.
-
Just one note: At least on Linux, the prefix "lib" is omitted on giving linker command lines, so it would look like this:
LIBS += -LC:/dev/cryptopp700/release -lcryptopp
In my experience it should be the same on MinGW, and would be more portable.
Regards
-
AFAIK the removal of prefix "lib" is a "feature" of GCC respectively the associated linker which is the basis also for MinGW. On linux it is important to neglect and there it might be better to do on windows as well, when the project shall be used on both platforms.
However, it has its ups and downs and most of the time there are also other OS dependent settings.