UltraStar-Creator
UltraStar-Creator copied to clipboard
qmake failing on macOS Ventura - taglib development package not found
Hi,
I'm attempting to follow the instructions in the readme to build this application on macOS Ventura (13.2). I've installed homebrew (although I had to follow the instructions at https://brew.sh/ as the master
branch has now been changed to HEAD
there). I've then installed both qt
and taglib
via brew
as directed.
Then on running qmake UltraStar-Creator.pro
within the src
directory I receive the following error:
Project ERROR: taglib development package not found
The version info of the version of taglib
I have installed is:
brew info taglib
==> taglib: stable 1.13.1 (bottled), HEAD Audio metadata library https://taglib.org/ /opt/homebrew/Cellar/taglib/1.13.1 (122 files, 1.6MB) * Poured from bottle using the formulae.brew.sh API on 2023-08-18 at 14:21:16 From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/t/taglib.rb License: LGPL-2.1 ==> Dependencies Build: cmake ✔ ==> Options --HEAD Install HEAD version ==> Analytics install: 4,179 (30 days), 18,706 (90 days), 22,192 (365 days) install-on-request: 210 (30 days), 660 (90 days), 860 (365 days) build-error: 0 (30 days)
And the same for qt
:
brew info qt
==> qt: stable 6.5.1 (bottled), HEAD Cross-platform application and UI framework https://www.qt.io/ /opt/homebrew/Cellar/qt/6.5.1_2 (14,033 files, 610.6MB) * Poured from bottle using the formulae.brew.sh API on 2023-08-13 at 22:08:09 From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/q/qt.rb License: BSD-3-Clause and GFDL-1.3-no-invariants-only and GPL-2.0-only and (GPL-3.0-only with Qt-GPL-exception-1.0) and LGPL-3.0-only ==> Dependencies Build: cmake ✔, ninja ✘, node ✘, pkg-config ✘, [email protected] ✘, six ✘, vulkan-headers ✘, vulkan-loader ✘, molten-vk ✘ Required: assimp ✔, brotli ✔, dbus ✔, double-conversion ✔, freetype ✔, glib ✔, harfbuzz ✔, hunspell ✔, icu4c ✔, jasper ✔, jpeg-turbo ✔, libb2 ✔, libmng ✔, libpng ✔, libtiff ✔, md4c ✔, openssl@3 ✔, pcre2 ✔, sqlite ✔, webp ✔, zstd ✔ ==> Requirements Build: Xcode (on macOS) ✔ ==> Options --HEAD Install HEAD version ==> Caveats You can add Homebrew's Qt to QtCreator's "Qt Versions" in: Preferences > Qt Versions > Link with Qt... pressing "Choose..." and selecting as the Qt installation path: /opt/homebrew ==> Analytics install: 16,318 (30 days), 62,228 (90 days), 111,327 (365 days) install-on-request: 10,719 (30 days), 47,866 (90 days), 87,006 (365 days) build-error: 52 (30 days)
My $PATH
shows:
/usr/local/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin
And in case it's helpful, I'm running Homebrew 4.1.5.
Can you provide any pointers which could be helpful to getting this package to compile?
Hi!
The error message sounds familiar. IIRC I had to add /usr/local/bin
to Qt Project -> Build Environment -> PATH, so that pkg-config can run correctly on taglib (which returns the compile and linker options for taglib), but I am not 100 % sure. If you haven’t you need to brew install pkg-config
as well.
Calling pkg-config --libs taglib
on the command line should return -L/usr/local/Cellar/taglib/1.13.1/lib -ltag -lz
.
Let me know if that helps in any way!
Thankyou for the speedy response. Running brew install pkg-config
got me past the command line qmake UltraStar-Creator.pro
call successfully. Yay!
However, now the make
command is giving me errors. C'est la vie. This is (I believe) because I'm on Apple's silicon - an Apple M2 Pro to be precise.
Inside the output of the command is the warning [building for macOS-arm64 but attempting to link with file built for macOS-x86_64](ld: warning: ignoring file ../lib/macx/libcld2.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64)
. This continues to the final error as shown below:
make
/Library/Developer/CommandLineTools/usr/bin/clang++ -stdlib=libc++ -Wl,-rpath,@executable_path/../Frameworks/ -headerpad_max_install_names -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -mmacosx-version-min=12.0 -Wl,-rpath,@executable_path/../Frameworks -Wl,-rpath,/opt/homebrew/lib -o ../bin/release/UltraStar-Creator.app/Contents/MacOS/UltraStar-Creator tmp/release/main.o tmp/release/QUMainWindow.o tmp/release/QU.o tmp/release/QUAboutDialog.o tmp/release/QUMessageBox.o tmp/release/QULogService.o tmp/release/QUMonty.o tmp/release/QUMontyArea.o tmp/release/QUSongSupport.o tmp/release/QUSongLine.o tmp/release/QUSongFile.o tmp/release/QUSongDatabase.o tmp/release/QUStringSupport.o tmp/release/qrc_UltraStar-Creator.o tmp/release/moc_QU.o tmp/release/moc_QUMainWindow.o tmp/release/moc_QUAboutDialog.o tmp/release/moc_QUMessageBox.o tmp/release/moc_QULogService.o tmp/release/moc_QUMontyArea.o tmp/release/moc_QUSongSupport.o tmp/release/moc_QUSongLine.o tmp/release/moc_QUSongInterface.o tmp/release/moc_QUSongFile.o tmp/release/moc_QUSongDatabase.o tmp/release/moc_QUStringSupport.o -F/opt/homebrew/lib -L../lib/macx -lbass -lbass_fx -lcld2 -L/opt/homebrew/Cellar/taglib/1.13.1/lib -ltag -lz -framework QtWidgets -framework QtGui -framework AppKit -framework ImageIO -framework Metal -framework QtNetwork -framework QtCore -framework IOKit -framework DiskArbitration -framework AGL -framework OpenGL
ld: warning: ignoring file ../lib/macx/libcld2.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64 ld: warning: dylib (/opt/homebrew/Cellar/taglib/1.13.1/lib/libtag.dylib) was built for newer macOS version (13.0) than being linked (12.0) ld: warning: dylib (/opt/homebrew/lib/QtCore.framework/QtCore) was built for newer macOS version (13.0) than being linked (12.0) ld: warning: dylib (/opt/homebrew/lib/QtGui.framework/QtGui) was built for newer macOS version (13.0) than being linked (12.0) ld: warning: dylib (/opt/homebrew/lib/QtWidgets.framework/QtWidgets) was built for newer macOS version (13.0) than being linked (12.0) ld: warning: dylib (/opt/homebrew/lib/QtNetwork.framework/QtNetwork) was built for newer macOS version (13.0) than being linked (12.0) Undefined symbols for architecture arm64: "CLD2::LanguageDeclaredName(CLD2::Language)", referenced from: QUMainWindow::on_pushButton_BrowseSubtitles_clicked() in QUMainWindow.o QUMainWindow::determineLanguage(QString) in QUMainWindow.o "CLD2::DetectLanguageSummary(char const*, int, bool, CLD2::Language*, int*, int*, bool*)", referenced from: QUMainWindow::on_pushButton_BrowseSubtitles_clicked() in QUMainWindow.o QUMainWindow::determineLanguage(QString) in QUMainWindow.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [../bin/release/UltraStar-Creator.app/Contents/MacOS/UltraStar-Creator] Error 1
https://doc.qt.io/qt-6/macos.html states that "By default, Qt will build for the architecture of your development machine", but also gave information about QMAKE_APPLE_DEVICE_ARCHS = x86_64 arm64
which I inserted into the .pro
file in the macx
section. This, however, simply reversed the error, giving me the following:
/Library/Developer/CommandLineTools/usr/bin/clang++ -stdlib=libc++ -Wl,-rpath,@executable_path/../Frameworks/ -headerpad_max_install_names -arch x86_64 -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -mmacosx-version-min=12.0 -Wl,-rpath,@executable_path/../Frameworks -Wl,-rpath,/opt/homebrew/lib -o ../bin/release/UltraStar-Creator.app/Contents/MacOS/UltraStar-Creator tmp/release/main.o tmp/release/QUMainWindow.o tmp/release/QU.o tmp/release/QUAboutDialog.o tmp/release/QUMessageBox.o tmp/release/QULogService.o tmp/release/QUMonty.o tmp/release/QUMontyArea.o tmp/release/QUSongSupport.o tmp/release/QUSongLine.o tmp/release/QUSongFile.o tmp/release/QUSongDatabase.o tmp/release/QUStringSupport.o tmp/release/qrc_UltraStar-Creator.o tmp/release/moc_QU.o tmp/release/moc_QUMainWindow.o tmp/release/moc_QUAboutDialog.o tmp/release/moc_QUMessageBox.o tmp/release/moc_QULogService.o tmp/release/moc_QUMontyArea.o tmp/release/moc_QUSongSupport.o tmp/release/moc_QUSongLine.o tmp/release/moc_QUSongInterface.o tmp/release/moc_QUSongFile.o tmp/release/moc_QUSongDatabase.o tmp/release/moc_QUStringSupport.o -F/opt/homebrew/lib -L../lib/macx -lbass -lbass_fx -lcld2 -L/opt/homebrew/Cellar/taglib/1.13.1/lib -ltag -lz -framework QtWidgets -framework QtGui -framework AppKit -framework ImageIO -framework Metal -framework QtNetwork -framework QtCore -framework IOKit -framework DiskArbitration -framework AGL -framework OpenGL
ld: warning: ignoring file tmp/release/main.o, building for macOS-x86_64 but attempting to link with file built for unknown-arm64 ld: warning: ignoring file tmp/release/QUAboutDialog.o, building for macOS-x86_64 but attempting to link with file built for unknown-arm64 ld: warning: ignoring file tmp/release/QU.o, building for macOS-x86_64 but attempting to link with file built for unknown-arm64 ld: warning: ignoring file tmp/release/QUMessageBox.o, building for macOS-x86_64 but attempting to link with file built for unknown-arm64 ld: warning: ignoring file tmp/release/QULogService.o, building for macOS-x86_64 but attempting to link with file built for unknown-arm64 ld: warning: ignoring file tmp/release/QUMonty.o, building for macOS-x86_64 but attempting to link with file built for unknown-arm64 ld: warning: ignoring file tmp/release/QUMainWindow.o, building for macOS-x86_64 but attempting to link with file built for unknown-arm64 ld: warning: ignoring file tmp/release/QUMontyArea.o, building for macOS-x86_64 but attempting to link with file built for unknown-arm64 ld: warning: ignoring file tmp/release/QUSongLine.o, building for macOS-x86_64 but attempting to link with file built for unknown-arm64 ld: warning: ignoring file tmp/release/QUStringSupport.o, building for macOS-x86_64 but attempting to link with file built for unknown-arm64 ld: warning: ignoring file tmp/release/QUSongSupport.o, building for macOS-x86_64 but attempting to link with file built for unknown-arm64 ld: warning: ignoring file tmp/release/QUSongDatabase.o, building for macOS-x86_64 but attempting to link with file built for unknown-arm64 ld: warning: ignoring file tmp/release/moc_QU.o, building for macOS-x86_64 but attempting to link with file built for unknown-arm64 ld: warning: ignoring file tmp/release/moc_QUMainWindow.o, building for macOS-x86_64 but attempting to link with file built for unknown-arm64 ld: warning: ignoring file tmp/release/moc_QUAboutDialog.o, building for macOS-x86_64 but attempting to link with file built for unknown-arm64 ld: warning: ignoring file tmp/release/moc_QUMontyArea.o, building for macOS-x86_64 but attempting to link with file built for unknown-arm64 ld: warning: ignoring file tmp/release/QUSongFile.o, building for macOS-x86_64 but attempting to link with file built for unknown-arm64 ld: warning: ignoring file tmp/release/moc_QUSongSupport.o, building for macOS-x86_64 but attempting to link with file built for unknown-arm64 ld: warning: ignoring file tmp/release/qrc_UltraStar-Creator.o, building for macOS-x86_64 but attempting to link with file built for unknown-arm64 ld: warning: ignoring file tmp/release/moc_QUSongLine.o, building for macOS-x86_64 but attempting to link with file built for unknown-arm64 ld: warning: ignoring file tmp/release/moc_QULogService.o, building for macOS-x86_64 but attempting to link with file built for unknown-arm64 ld: warning: ignoring file tmp/release/moc_QUMessageBox.o, building for macOS-x86_64 but attempting to link with file built for unknown-arm64 ld: warning: ignoring file tmp/release/moc_QUSongFile.o, building for macOS-x86_64 but attempting to link with file built for unknown-arm64 ld: warning: ignoring file tmp/release/moc_QUSongInterface.o, building for macOS-x86_64 but attempting to link with file built for unknown-arm64 ld: warning: ignoring file tmp/release/moc_QUSongDatabase.o, building for macOS-x86_64 but attempting to link with file built for unknown-arm64 ld: warning: ignoring file tmp/release/moc_QUStringSupport.o, building for macOS-x86_64 but attempting to link with file built for unknown-arm64 ld: warning: ignoring file /opt/homebrew/lib/QtWidgets.framework/QtWidgets, building for macOS-x86_64 but attempting to link with file built for macOS-arm64 ld: warning: ignoring file /opt/homebrew/lib/QtGui.framework/QtGui, building for macOS-x86_64 but attempting to link with file built for macOS-arm64 ld: warning: ignoring file /opt/homebrew/Cellar/taglib/1.13.1/lib/libtag.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64 ld: warning: ignoring file /opt/homebrew/lib/QtCore.framework/QtCore, building for macOS-x86_64 but attempting to link with file built for macOS-arm64 ld: warning: ignoring file /opt/homebrew/lib/QtNetwork.framework/QtNetwork, building for macOS-x86_64 but attempting to link with file built for macOS-arm64 Undefined symbols for architecture x86_64: "_main", referenced from: implicit entry/start for main executable ld: symbol(s) not found for architecture x86_64
It feels like I'm very close to getting this running, but to no avail. If we do manage to get this to work, I will of course open a PR with whatever changes were necessary both in code and documentation, to help the next folks who come along.
Thanks again for all your help!
Ah, I compiled cld2 myself. I guess you will have to compile a compatible version of it yourself (https://github.com/CLD2Owners/cld2) and replace the existing lib/macx/libcld2.dylib
Ah, I compiled cld2 myself. I guess you will have to compile a compatible version of it yourself (https://github.com/CLD2Owners/cld2) and replace the existing
lib/macx/libcld2.dylib
I tried to compile the cld2 myself, but it is generating a .so file instead of .dylib. By any chance, do you know how I could progress? I'm receiving the exact same error in with the macOS Ventura.
I adapted compile_libs.sh
in the following way:
You may also need to also pass -dynamiclib
to g++
to actually make them a dylib:
g++ $CFLAGS $CPPFLAGS $CXXFLAGS -shared -fPIC -dynamiclib \
cldutil.cc cldutil_shared.cc compact_lang_det.cc compact_lang_det_hint_code.cc \
compact_lang_det_impl.cc debug.cc fixunicodevalue.cc \
generated_entities.cc generated_language.cc generated_ulscript.cc \
getonescriptspan.cc lang_script.cc offsetmap.cc scoreonescriptspan.cc \
tote.cc utf8statetable.cc \
cld_generated_cjk_uni_prop_80.cc cld2_generated_cjk_compatible.cc \
cld_generated_cjk_delta_bi_4.cc generated_distinct_bi_0.cc \
cld2_generated_quadchrome_2.cc cld2_generated_deltaoctachrome.cc \
cld2_generated_distinctoctachrome.cc cld_generated_score_quad_octa_2.cc \
-o libcld2.dylib $LDFLAGS -Wl,-install_name,libcld2.dylib
g++ $CFLAGS $CPPFLAGS $CXXFLAGS -shared -fPIC -dynamiclib \
cldutil.cc cldutil_shared.cc compact_lang_det.cc compact_lang_det_hint_code.cc \
compact_lang_det_impl.cc debug.cc fixunicodevalue.cc \
generated_entities.cc generated_language.cc generated_ulscript.cc \
getonescriptspan.cc lang_script.cc offsetmap.cc scoreonescriptspan.cc \
tote.cc utf8statetable.cc \
cld_generated_cjk_uni_prop_80.cc cld2_generated_cjk_compatible.cc \
cld_generated_cjk_delta_bi_32.cc generated_distinct_bi_0.cc \
cld2_generated_quad0122.cc cld2_generated_deltaocta0122.cc \
cld2_generated_distinctocta0122.cc cld_generated_score_quad_octa_0122.cc \
-o libcld2_full.dylib $LDFLAGS -Wl,-install_name,libcld2_full.dylib
@NeilCrosby if you're still trying to get this to run on an ARM Mac, there is now a build artifact that should run on these here if you scroll down (MAC-ARM)
There's no instructions for the README yet, but if you want to compile this yourself, basically just follow the steps in the build_mac
section of .github/workflows/main.yml
, these build successfully on an M1 Mac in the CI