Trouble Getting OpenSSL To Work On Mac
-
Hello and Happy New Year,
I am porting an application over to my new Macbook Pro and I'm having trouble getting OpenSSL to work in QT. I'm using the latest version of Qt Creator and Qt 6.5.3 clang. Here is my code:
In my .pro file:
INCLUDEPATH += "$$PWD/openssl@3/3.2.0_1/include/openssl" LIBS += L"$$PWD/openssl@3/3.2.0_1/include/openssl" openssl/configuration.h LIBS += L"$$PWD/openssl@3/3.2.0_1/include/openssl" openssl/opensslconf.h LIBS += L"$$PWD/openssl@3/3.2.0_1/include/openssl" openssl/macros.h LIBS += L"$$PWD/openssl@3/3.2.0_1/include/openssl" openssl/types.h LIBS += L"$$PWD/openssl@3/3.2.0_1/include/openssl" openssl/core.h LIBS += L"$$PWD/openssl@3/3.2.0_1/include/openssl" openssl/core_dispatch.h LIBS += L"$$PWD/openssl@3/3.2.0_1/include/openssl" openssl/symhacks.h LIBS += L"$$PWD/openssl@3/3.2.0_1/include/openssl" openssl/bio.h LIBS += L"$$PWD/openssl@3/3.2.0_1/include/openssl" openssl/evperr.h LIBS += L"$$PWD/openssl@3/3.2.0_1/include/openssl" openssl/params.h LIBS += L"$$PWD/openssl@3/3.2.0_1/include/openssl" openssl/evp.h
And in my .h file:
#include <openssl/configuration.h> #include <openssl/opensslconf.h> #include <openssl/types> #include <openssl/core.h> #include <openssl/core_dispatch.h> #include <openssl/symhacks.h> #include <openssl/bio.h> #include <openssl/evperr.h> #include <openssl/params.h> #include "evp.h"
I have tried adding the "-l" parameter before the files in my .pro file. I have tried just about everything I can think of. I want OpenSSL to do checksums for me. I know that this feature is built into Qt, but now I am wondering why I can't include these files in my .h file. I have installed OpenSSL 3.0 (or 3.2) from Homebrew, and I have copied them over to my working directory for ease of use. The top include line says that the file can't be found, when it is clearly there. Any help would be appreciated.
-
Hi,
- unless you are developing within your homebrew installation (and if so, you really should not), your use of
$$PWD
is wrong. Use the full path. - Either remove the openssl portion of the path from the INCLUDEPATH variable entry or from your include statements. I would recommend the former.
- Your LIBS line do not make sense. This variable is to add library search paths (i.e.
-L
and you are missing the-
) and libraries with-l
which you are not doing.
- unless you are developing within your homebrew installation (and if so, you really should not), your use of
-
Hi,
- unless you are developing within your homebrew installation (and if so, you really should not), your use of
$$PWD
is wrong. Use the full path. - Either remove the openssl portion of the path from the INCLUDEPATH variable entry or from your include statements. I would recommend the former.
- Your LIBS line do not make sense. This variable is to add library search paths (i.e.
-L
and you are missing the-
) and libraries with-l
which you are not doing.
- unless you are developing within your homebrew installation (and if so, you really should not), your use of
-