Solved Library not loaded: /usr/local/Cellar/openssl/1.0.2k/lib/libcrypto.1.0.0.dylib
-
@ambershark The correct way in this case would be to bundle the dependencies correctly as well as fix their search paths.
-
@SGaist @ambershark What's the best way to bundle those ssl (-lssl and -lcrypto) libraries with my packaged application?
-
@IshM Well putting them in your bundle library section and setting the paths with otool would work and is how it's normally done.
However, the licensing of openssl needs to be reviewed. You may not be allowed to distribute binaries like that.
-
To add to @ambershark, macdeployqt is the tool to help deployment of macOS applications.
-
@SGaist @ambershark This is what I added to my project file and it seems to work now
mac: LIBS += -framework AppKit /usr/local/opt/openssl/lib/libssl.a /usr/local/opt/openssl/lib/libcrypto.a -framework IOKit -framework CoreAudio -framework Carbon
(thelibcrypto
andlibssl
part).Is this way correct?
-
@IshM Well yes, that will work since you are linking them statically so you don't need to distribute the libraries any more.
However, be warned that you have the same licensing issues. If your app is not open source you will need to check into the license requirements for linking to a binary openssl like that or it could cost you a lot of money.
-
@ambershark Is this the license that I'll have to satisfy https://www.openssl.org/source/license.html or are there some other conditions as well?
-
AFAIK, that's the reference.
-
@IshM That looks easy to satisfy. It's not under any GPL/LGPL which are not easy to satisfy.
Just follow that license and you should be fine. :)
-
@SGaist @ambershark Thanks guys. It's a lot of help.
-
Hi, guys!
I seem to have found a solution.I try to:
$ cd MyApp.app/Contents/Frameworks $ otool -L libssl.1.0.0.dylib libssl.1.0.0.dylib: @executable_path/../Frameworks/libssl.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/local/Cellar/openssl/1.0.2n/lib/libcrypto.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.60.2) $ install_name_tool -change /usr/local/Cellar/openssl/1.0.2n/lib/libcrypto.1.0.0.dylib @executable_path/../Frameworks/libcrypto.1.0.0.dylib libssl.1.0.0.dylib
It worked.