Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Including Cryptopp lib



  • I have compiled cryptopp using mingw on windows 10 and added INCLUDEPATH and LIBS 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 my INCLUDEPATH and LIBS 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.



  • @dhamith93

    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.



  • Thank you! it worked!



  • @dhamith93 please don't forget to mark your post as solved! Thanks.


  • Lifetime Qt Champion

    @dhamith93

    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



  • @aha_1980 @dhamith93

    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.


Log in to reply