Unsolved Adding 3rd party libraries for deployment
-
@raven-worx Just running
macdeployqt ./MyApplication.app
will allow the dmg to run the application in my local. But when I send the application to other systems, it will not be able to even open the window.It should be because of the external libraries being used. Because when I sent a sample default application without any external library it worked perfectly. Can you please tell how to solve this problem
-
To include a 3rd party library in the application bundle, copy the library into the bundle manually, after the bundle is created.
-
@raven-worx How to do that?
I see people saying to useinstall_name_tool
but in my case which folder should I add in what location? -
@Arqam
you may want to take a look at macdylibbundler
I am not very experienced with MacOSX development. Maybe @SGaist can help here? -
What exact error do you get with OpenCV ?
You can crank up the verbose level to get more information about what exactly is going on.
-
@SGaist I have to do something extra for including external library (opencv here) with my project before macdeployqt right?
I want to know what I need to do to add external libraries so that the app works in deployment. -
@raven-worx said in Adding 3rd party libraries for deployment:
macdylibbundler
We have to manually copy the required libraries to our .app folder right.
Apart from copying do we need to do anything else? -
@raven-worx What command should I use to get all the dependecies of all the external libraries for macdylibbundler. As the read me didn't tell what to use.
-
@Arqam said in Adding 3rd party libraries for deployment:
As the read me didn't tell what to use.
Really? Not even on the very bottom of the page?!
% dylibbundler -od -b -x ./HelloWorld.app/Contents/MacOS/helloworld
-d ./HelloWorld.app/Contents/libs-ppc/ -p @executable_path/../libs-ppc/% dylibbundler -od -b -x ./HelloWorld.app/Contents/MacOS/helloworld
-d ./HelloWorld.app/Contents/libs-intel/ -p @executable_path/../libs-intel/ -
If your dependencies are built/installed properly, there's nothing special to do because macdeployqt should be able to locate the files based on the information within your application binary since it uses macOS tools to do its magic.
-
@SGaist But after macdeployqt we have to copy the 3rd party library to our Content/Frameworks folder right?
-
@SGaist I tried running in a different system, there when I saw the QT frameworks were proper inside the Content/Framework folder but the opencv libraries that I copied in the Framework folder were not proper. And the dmg app was not running.
What should I do apart from copying the library in the Framework folder? -
Did you take a look at the macOS deployment guide ?
-
@SGaist said in Adding 3rd party libraries for deployment:
macOS deployment guide
Yeah I did look into that. My project which is not using any external library works fine, but this one which is using openCV is not working. I have uploaded the build directory folder, can you please have a look : https://github.com/torrtuga/QTBuildApp
-
How did you install OpenCV in the first place ?
-
By the way, you copied the symbolic link in your bundle not the actual libraries.
-
@SGaist Hi, thanks a lot for the reply.
I followed the instructions here to configure openCV to my QT project : https://www.learnopencv.com/configuring-qt-for-opencv-on-osx/
I had openCV in my system from earlier only.
-
How did the OpenCV links get into the application bundle ?