Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot build on dev: macOS #967

Closed
mathjiajia opened this issue Feb 11, 2024 · 6 comments
Closed

cannot build on dev: macOS #967

mathjiajia opened this issue Feb 11, 2024 · 6 comments

Comments

@mathjiajia
Copy link

with #926 (comment) in mind, still got an error:

In file included from pdf_viewer/coordinates.cpp:1:
pdf_viewer/coordinates.h:160:23: error: no member named 'max' in namespace 'std'; did you mean 'fmax'?
        res.x1 = std::max(R::x1, other.x1);
                 ~~~~~^~~
                      fmax
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:434:9: note: 'fmax' declared here
using ::fmax _LIBCPP_USING_IF_EXISTS;
        ^
In file included from pdf_viewer/coordinates.cpp:1:
pdf_viewer/coordinates.h:162:23: error: no member named 'max' in namespace 'std'; did you mean 'fmax'?
        res.y1 = std::max(R::y1, other.y1);
                 ~~~~~^~~
                      fmax
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:434:9: note: 'fmax' declared here
using ::fmax _LIBCPP_USING_IF_EXISTS;
        ^
@ahrm
Copy link
Owner

ahrm commented Feb 11, 2024

This error should be fixed in f75aa76.

@mathjiajia
Copy link
Author

Thanks for the response.
Now it works well and generates the dmg file.
However, there are some other errors (and the resulting app can NOT be opened = no reaction):

ERROR: Cannot resolve rpath "@rpath/QtGui.framework/Versions/A/QtGui"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtCore.framework/Versions/A/QtCore"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtWidgets.framework/Versions/A/QtWidgets"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtGui.framework/Versions/A/QtGui"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtCore.framework/Versions/A/QtCore"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtNetwork.framework/Versions/A/QtNetwork"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtCore.framework/Versions/A/QtCore"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtNetwork.framework/Versions/A/QtNetwork"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtCore.framework/Versions/A/QtCore"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtNetwork.framework/Versions/A/QtNetwork"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtCore.framework/Versions/A/QtCore"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtNetwork.framework/Versions/A/QtNetwork"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtCore.framework/Versions/A/QtCore"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtNetwork.framework/Versions/A/QtNetwork"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtCore.framework/Versions/A/QtCore"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtGui.framework/Versions/A/QtGui"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtCore.framework/Versions/A/QtCore"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtGui.framework/Versions/A/QtGui"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtCore.framework/Versions/A/QtCore"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtGui.framework/Versions/A/QtGui"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtCore.framework/Versions/A/QtCore"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtGui.framework/Versions/A/QtGui"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtCore.framework/Versions/A/QtCore"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtGui.framework/Versions/A/QtGui"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtCore.framework/Versions/A/QtCore"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtGui.framework/Versions/A/QtGui"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtCore.framework/Versions/A/QtCore"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtGui.framework/Versions/A/QtGui"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtCore.framework/Versions/A/QtCore"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtPdf.framework/Versions/A/QtPdf"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtGui.framework/Versions/A/QtGui"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtCore.framework/Versions/A/QtCore"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtSvg.framework/Versions/A/QtSvg"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtGui.framework/Versions/A/QtGui"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtCore.framework/Versions/A/QtCore"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtGui.framework/Versions/A/QtGui"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtCore.framework/Versions/A/QtCore"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtGui.framework/Versions/A/QtGui"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtCore.framework/Versions/A/QtCore"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtGui.framework/Versions/A/QtGui"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtCore.framework/Versions/A/QtCore"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtGui.framework/Versions/A/QtGui"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtCore.framework/Versions/A/QtCore"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtSvg.framework/Versions/A/QtSvg"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtGui.framework/Versions/A/QtGui"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtCore.framework/Versions/A/QtCore"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtVirtualKeyboard.framework/Versions/A/QtVirtualKeyboard"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtQuick.framework/Versions/A/QtQuick"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtQmlModels.framework/Versions/A/QtQmlModels"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtQml.framework/Versions/A/QtQml"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtNetwork.framework/Versions/A/QtNetwork"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtOpenGL.framework/Versions/A/QtOpenGL"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtGui.framework/Versions/A/QtGui"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtCore.framework/Versions/A/QtCore"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtMultimedia.framework/Versions/A/QtMultimedia"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtGui.framework/Versions/A/QtGui"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtNetwork.framework/Versions/A/QtNetwork"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtCore.framework/Versions/A/QtCore"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtTextToSpeech.framework/Versions/A/QtTextToSpeech"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtMultimedia.framework/Versions/A/QtMultimedia"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtGui.framework/Versions/A/QtGui"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtNetwork.framework/Versions/A/QtNetwork"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtCore.framework/Versions/A/QtCore"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtTextToSpeech.framework/Versions/A/QtTextToSpeech"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtMultimedia.framework/Versions/A/QtMultimedia"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtGui.framework/Versions/A/QtGui"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtNetwork.framework/Versions/A/QtNetwork"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtCore.framework/Versions/A/QtCore"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtTextToSpeech.framework/Versions/A/QtTextToSpeech"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtMultimedia.framework/Versions/A/QtMultimedia"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtGui.framework/Versions/A/QtGui"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtNetwork.framework/Versions/A/QtNetwork"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
ERROR: Cannot resolve rpath "@rpath/QtCore.framework/Versions/A/QtCore"
ERROR:  using QList("/Users/jia/sioyek/build/lib")
updating: build/sioyek.dmg (deflated 2%)

@ahrm
Copy link
Owner

ahrm commented Feb 11, 2024

I don't have mac so I can't help you much here, maybe someone with a mac can help. Which version of qt did you install?

@mathjiajia
Copy link
Author

I am using qt 6.6.1 from Homebrew.

@jinjiaodawang
Copy link
Contributor

I encountered the same issue and believe it's a bug that occurs if you install Qt via Homebrew. Please uninstall Qt6 from brew, and reinstall qt6 by aqtinstall:

pip install aqtinstall
cd /path/to/qt
aqt install-qt mac desktop 6.6.1 clang_64 -m all
export Qt6_DIR=/path/to/qt/6.6.1/macos/
export QT_PLUGIN_PATH=/path/to/qt/6.6.1/macos/plugins
export PKG_CONFIG_PATH=/path/to/qt/6.6.1/macos/lib/pkgconfig
export QML2_IMPORT_PATH=/path/to/qt/6.6.1/macos/qml
export PATH="/path/to/qt/6.6.1/macos/bin:$PATH"

Then rebuild Sioyek. If this resolves the issue on your end, I will submit this script as a PR to the development branch.

@mathjiajia
Copy link
Author

I encountered the same issue and believe it's a bug that occurs if you install Qt via Homebrew. Please uninstall Qt6 from brew, and reinstall qt6 by aqtinstall:

pip install aqtinstall
cd /path/to/qt
aqt install-qt mac desktop 6.6.1 clang_64 -m all
export Qt6_DIR=/path/to/qt/6.6.1/macos/
export QT_PLUGIN_PATH=/path/to/qt/6.6.1/macos/plugins
export PKG_CONFIG_PATH=/path/to/qt/6.6.1/macos/lib/pkgconfig
export QML2_IMPORT_PATH=/path/to/qt/6.6.1/macos/qml
export PATH="/path/to/qt/6.6.1/macos/bin:$PATH"

Then rebuild Sioyek. If this resolves the issue on your end, I will submit this script as a PR to the development branch.

It works well on my machine. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants