0

I have compiled and tried to link the cryptopp library to my .pro file but I get this error:

error: 'cryptopp/aes.h' file not found
#include <cryptopp/aes.h>

Below is my .pro file:

QT       += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = Journal
TEMPLATE = app
DEFINES += QT_DEPRECATED_WARNINGS
LIBS += -L/usr/local/lib/libcryptopp.a -lcryptopp
CONFIG += console c++11

SOURCES += \
        main.cpp \
        mainwindow.cpp \
    encrypt.cpp

HEADERS += \
        mainwindow.h \
    filesio.h \
    encrypt.h

FORMS += \
        mainwindow.ui

How could I resolve this error? Thanks

jww
  • 97,681
  • 90
  • 411
  • 885
  • You have to specify location of your include files. You can refer to `INCLUDEPATH` specifier: http://doc.qt.io/qt-5/qmake-variable-reference.html#includepath . – vahancho Aug 01 '17 at 06:34
  • Change `LIBS += -L/usr/local/lib/libcryptopp.a -lcryptopp` to `LIBS += -lcryptopp` or `LIBS += -L/usr/local/lib-lcryptopp -lcryptopp` – eyllanesc Aug 01 '17 at 06:41
  • When the libraries are `/usr/lib` or `/usr/local/lib` it is not necessary to indicate the path – eyllanesc Aug 01 '17 at 06:43
  • I changed LIBS to both of those and still received them same error and then I tried the INCLUDEPATH specifier and still the same error appeared. The editor can find the files and can view the headers but only when compiling do I receive the error about not being able to find these headers –  Aug 01 '17 at 06:50
  • [How to add include path in Qt Creator?](https://stackoverflow.com/q/2752352/608639) and maybe [INCLUDEPATH in qmake project file doesn't work](https://stackoverflow.com/q/19048098/608639) (but it looks like the first issue since there is no indication of including the Crypto++ library headers). – jww Aug 01 '17 at 10:44
  • After running QMake with the include path specified it began to work thanks everyone for their assistance –  Aug 01 '17 at 11:16

1 Answers1

1

As suggested by vahancho, you need to add below line in you qmake project file.

INCLUDEPATH += path to parent directory of 'cryptopp'

user2042397
  • 146
  • 1
  • 5