Humor me? Trying to make a build of Qt 4.8.0 on MacOS 11.6.1
-
I am attempting to resurrect a Qt3 application I wrote many years ago. Rather than try converting it to Qt4 (yet), I am trying to hack a working build-and-install of Qt-4.8.0 on my Mac running 11.6.1 (Xcode 13) with Qt3 support turned on.
At this point, I have:
- Configured without -developer-build (so I could avoid the -Wall errors and install externally). Also am configured to build -static because this is a one-time project to get an old Qt3 app working again.
- Found all the patches needed to fix changes in C++ and changes in the Apple APIs
- Finally got all source files compiling in both the Debug and Release versions, and have all libraries linked and built.
The problem: All the executables within the Qt build system (uic3, etc) fail to link with a long set of errors of this form:
[Mac-Pro:src/tools/uic3] dscott% g++ -Xlinker -v -headerpad_max_install_names -arch x86_64 -all_load -Xarch_x86_64 -mmacosx-version-min=11.6 -o ../../../bin/uic3 .obj/release-static/customwidgetsinfo.o .obj/release-static/databaseinfo.o .obj/release-static/driver.o .obj/release-static/treewalker.o .obj/release-static/ui4.o .obj/release-static/validator.o .obj/release-static/cppextractimages.o .obj/release-static/cppwritedeclaration.o .obj/release-static/cppwriteicondata.o .obj/release-static/cppwriteicondeclaration.o .obj/release-static/cppwriteiconinitialization.o .obj/release-static/cppwriteincludes.o .obj/release-static/cppwriteinitialization.o .obj/release-static/main.o .obj/release-static/ui3reader.o .obj/release-static/parser.o .obj/release-static/domtool.o .obj/release-static/object.o .obj/release-static/subclassing.o .obj/release-static/form.o .obj/release-static/converter.o .obj/release-static/widgetinfo.o .obj/release-static/embed.o .obj/release-static/qt3to4.o .obj/release-static/deps.o .obj/release-static/uic.o -L/opt/local/src/qt-everywhere-opensource-src-4.8.0/lib -lQt3Support -L/opt/local/src/qt-everywhere-opensource-src-4.8.0/lib -lQtSql -framework ApplicationServices -framework CoreFoundation -framework Carbon -framework AppKit -lQtNetwork -framework SystemConfiguration -lresolv -lQtXml -lQtGui -lQtCore -lz -lm
@(#)PROGRAM:ld PROJECT:ld64-711
BUILD 18:11:15 Aug 3 2021
configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em
Library search paths:
/opt/local/src/qt-everywhere-opensource-src-4.8.0/lib
/opt/local/src/qt-everywhere-opensource-src-4.8.0/lib
/usr/local/lib
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib
Framework search paths:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/
Undefined symbols for architecture x86_64:
"QHistoryState::staticMetaObject", referenced from:
QStateMachinePrivate::clearHistory() in libQtCore.a(qstatemachine.o)
QStatePrivate::childStates() const in libQtCore.a(qstate.o)
QStatePrivate::historyStates() const in libQtCore.a(qstate.o)
"QPluginLoader::staticMetaObject", referenced from:
QPluginLoader::unload() in libQtCore.a(qpluginloader.o)
QPluginLoader::errorString() const in libQtCore.a(qpluginloader.o)All the online posts about this issue talk about config and coding errors, or not running moc, etc. -- but this is all internal code. Could this be related to the -static?
-
You may try to sell your app as antique to Qt. I would think very few people even finish reading your post. I did not. If you still remember your layout, simply make a new one from scratch with Qt6.
@JoeCFD I only need one helpful person with an answer to respond in order to make my post worthwhile.
-
Hi,
Which options did you pass to configure ?
Did you setup a repository with the patches ?
Did you consider using homebrew to install Qt4 ? -
Hi,
Which options did you pass to configure ?
Did you setup a repository with the patches ?
Did you consider using homebrew to install Qt4 ?@SGaist Thanks for replying! Initial answers:
- Command-line history for that is long-gone - is there a way to get configure to print its current settings?
- I don't really understand the question - I had to hand-patch via text editor into an old non-Git version of the 4.8.0 code
- I don't currently use brew for any software installations, but it may come to that. It would have to be a Qt4 build with Qt3 support enabled. Would that be obvious?
-
Yes, there is a file a the top of your build folder that contains them.
You wrote that you found patches so you could have put them all together for easier reuse.
By the way, why 4.8.0 ? There's 4.8.7 that is the latest and greatest of that series and it is available through git.I don't know if they built it with Qt 3 compatibility library enabled.
On a side note, you might want to consider using a Linux virtual machine or Docker to do the porting to Qt 4. It would likely be easier to setup.
-
Yes, there is a file a the top of your build folder that contains them.
You wrote that you found patches so you could have put them all together for easier reuse.
By the way, why 4.8.0 ? There's 4.8.7 that is the latest and greatest of that series and it is available through git.I don't know if they built it with Qt 3 compatibility library enabled.
On a side note, you might want to consider using a Linux virtual machine or Docker to do the porting to Qt 4. It would likely be easier to setup.
@SGaist said in Humor me? Trying to make a build of Qt 4.8.0 on MacOS 11.6.1:
Yes, there is a file a the top of your build folder that contains them.
Thanks!! "-static -no-accessibility -no-multimedia -no-audio-backend -no-phonon -no-phonon-backend -no-webkit -no-javascript-jit -no-declarative-debug -platform macx-g++ -no-openssl -no-framework -arch x86_64 -prefix /opt/local/Qt-4.8.0 -confirm-license"
By the way, why 4.8.0 ? There's 4.8.7 that is the latest and greatest of that series and it is available through git.
This is what I had on my machine from back in the day. I had no clear indication that 4.8.7 would solve any of my issues.
On a side note, you might want to consider using a Linux virtual machine or Docker to do the porting to Qt 4. It would likely be easier to setup.
Hmm. I have a Linux VM. Let me look into that, thanks!
-
Yes, there is a file a the top of your build folder that contains them.
You wrote that you found patches so you could have put them all together for easier reuse.
By the way, why 4.8.0 ? There's 4.8.7 that is the latest and greatest of that series and it is available through git.I don't know if they built it with Qt 3 compatibility library enabled.
On a side note, you might want to consider using a Linux virtual machine or Docker to do the porting to Qt 4. It would likely be easier to setup.
@SGaist You said "On a side note, you might want to consider using a Linux virtual machine or Docker to do the porting to Qt 4. It would likely be easier to setup."
I cannot find any installable or compilable version of Qt 4 anywhere! The main Qt site does not have it. Am I missing something?
-
@SGaist You said "On a side note, you might want to consider using a Linux virtual machine or Docker to do the porting to Qt 4. It would likely be easier to setup."
I cannot find any installable or compilable version of Qt 4 anywhere! The main Qt site does not have it. Am I missing something?
@Douglas_A_Scott said in Humor me? Trying to make a build of Qt 4.8.0 on MacOS 11.6.1:
I cannot find any installable or compilable version of Qt 4 anywhere! The main Qt site does not have it. Am I missing something?
-
@Douglas_A_Scott said in Humor me? Trying to make a build of Qt 4.8.0 on MacOS 11.6.1:
I cannot find any installable or compilable version of Qt 4 anywhere! The main Qt site does not have it. Am I missing something?
@JKSH Thank you!
-
@Douglas_A_Scott said in Humor me? Trying to make a build of Qt 4.8.0 on MacOS 11.6.1:
I cannot find any installable or compilable version of Qt 4 anywhere! The main Qt site does not have it. Am I missing something?
@JKSH Urk! Spoke too soon! The installable Mac image, qt-opensource-mac-4.8.7.dmg, will not install on a machine with the OS version I have. The installer package is not allowed to install where it wants to, and there is no way to reset where it plans to install. Hmmm.
-
@JKSH Urk! Spoke too soon! The installable Mac image, qt-opensource-mac-4.8.7.dmg, will not install on a machine with the OS version I have. The installer package is not allowed to install where it wants to, and there is no way to reset where it plans to install. Hmmm.
@Douglas_A_Scott said in Humor me? Trying to make a build of Qt 4.8.0 on MacOS 11.6.1:
Urk! Spoke too soon! The installable Mac image, qt-opensource-mac-4.8.7.dmg, will not install on a machine with the OS version I have. The installer package is not allowed to install where it wants to, and there is no way to reset where it plans to install. Hmmm.
macOS has changed way too much in the last decade, so I'm not surprised that the installer doesn't work.
You can try to compile it from source, but I have a feeling you'll be fighting an uphill battle. A VM with an old OS would likely be easier.
-
I think you are over-complicating things here.
If memory serves well, Qt 4 was removed from repositories with Debian 11 so anything before that has Qt 4 and all the required development packages that you can install and use for porting your application. I would recommend a basic Debian 10 to get started and you will be able to port your application with the added benefit that this version will be the latest of the series so even easier to move to Qt 5 / 6 afterwards.