Error when using macdeployqt
-
Actually if I try this for a desktop application with buttons and menus, none of the buttons and menus works! Actually, with previous Qt's versions I remember that macdeployqt used to work just fine!
-
Thanks for the -verbose=3 tip Alexis, that helped out a lot.
I've almost got a solution for this. Turns out there are two separate issues:
I) Apparently I've built and installed QtMultimediaKit wrong. Not sure what the exact problem is, but copying everything into the file path that the tool is expecting gets rid of that first error message. I'm not going to bother fixing the real issue because QtMultimediaKit will likely get merged into the main body of Qt(phonon is being deprecated in 4.8).
II) The rest of the errors are caused by a "known bug":https://bugreports.qt.nokia.com/browse/QTSDK-732 in 4.7.3. Apparently the Beta of 4.8 fixes this.
I've successfully migrated to 4.8 on the PC, but I'm having some difficulties in the Mac. The 3 things I have done so far:
- Install 4.8 using the updater (it is in the experimental section).
- Setup my project to build using 4.8 (really easy, just create a new 4.8 build in the projects section)
- Copied the file "mobility.prf" from 4.7.3/mingw/mkspecs/features to the equivalent directory in 4.8.0. This file was automatically generated when I built mobility. Just copying this file doesn't appear to hurt anything on the PC.
As mentioned, these steps on the PC makes it build and run just fine. However on the Mac I am getting build errors to the effect of "Class A is implemented in both 473 and 4.8.0. One of the two will be used. Which one is undefined." These errors are appearing for most (if not all) of the Qt Classes I am using. I am not sure how to force Qt to use the correct version. I am also getting run errors saying QTimer can only be used in threads started with QThread. However, I am not directly using QTimer (I wouldn't be surprised if some of the Qt classes I am using are).
Any insights on how to move my code into 4.8 on the Mac would be appreciated.
-
As long as the library paths are not changed with install_name_tool (usually by macdeployqt), it uses the paths hardcoded in the libs. It looks like your QtMultimediaKit is still built against 4.7.3, which could be the cause of the trouble. I'd try to build that against 4.8 too. Maybe macdeployqt only changes paths of the libs that ware built against a specific Qt version, but not the others. I did not check that, so it's only a guess.
-
You are correct Volker, the QtMultiMediaKit is hard coded to look for 4.7.3.
I have tried a couple times to rebuild Mobility against 4.8.0 (once against 4.8.0 downloaded-by-the-updater and once against a freshly-built-from-source copy of 4.8.0), but I keep getting the error "'qt7movievideowidgetmm:94: error: 'gluOrtho2D' was not declared in this scope". This is odd because earlier in the output it looks like the Qt OpenGL package is included just fine.
Steps I am doing to build QtMultiMediaKit:
- Setup my PATH variable to include the bin directory in 4.8.0 (and no other versions of Qt SKD just in case).
2)Configure Mobility 1.1.3 with:
configure -prefix path/to/where/i/want/Mobility -modules multimedia
3)make
BAM run into gluOrtho2D error after building for a while
Any ideas on the cause?
- Setup my PATH variable to include the bin directory in 4.8.0 (and no other versions of Qt SKD just in case).
-
Nope, I did not touch 4.8 yet :-)
As 4.8 is "only" a beta, I'd suggest you open a bugreport in the "bug tracker":https://bugreports.qt.nokia.com
-
Wow, speedy reply!
I will be sure to open a bugreport.
Where can I get a copy of an older version of the Qt SDK? I read the macdeployqt bug isn't present in earlier versions of Qt and I need to get a deploy-able package together for a presentation this week.
-
I just noticed that my version of Mobility was out of date (latest version is 1.2). Updating to the latest version fixed the build problem.
I was able to build and run my program successfully in 4.8.0. I was also able to run macdeployqt without any errors!
However, I won't mark it as solved yet because while it is copying all the frameworks, it is not updating the references correctly for all of them. otool -L reports that QtMultimediaKit is correctly referencing the internal copy, but the rest of the Qt Frameworks are not.
I'm going to look into fixing it manually.
-
Still no luck getting the app bundle to run on a non development Mac.
I used install_name_tool to update the framework path for my bundle. Now otool reports all the Qt Frameworks have a path such as:
@executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore
(4 other Qt paths listed in the tool but not shown here)I verified that all the paths are correct, and that all the non-Qt dylibs are either in the bundle or on the test computer (I did not check the dylib versions).
The bundle runs fine on my development computer, but has an "unexpected error" on another Mac.
Any suggestions?
-
I did more reading on how to use install_name_tool. Looks like you have to adjust the dependency paths for each of the libraries individually. In all I think I had to manually adjust about 20 or so paths.
I noticed that some of the paths had 2 or even 3 slashes separating just 1 directory level. Perhaps this is what is tripping up macdeployqt.
I am still getting an error, but I think it is because I am testing on a Mac version 10.5 and compiled my 3rd party libraries (incorrectly) on 10.6. I will test on a new Mac version and also look into recompiling my 3rd party libraries.
-
You can try to run the application from the command line terminal like this:
@
/full/path/to/your/application/MyProgram.app/Contents/MacOS/MyProgram
@You get the output of stdout and stderr then. Chances are good that you know what's complaining.
That output is saved in the system logs in case you start the application from the Finder. Just start /Applications/Utilities/Console.app to see those.