CefView / QCefView

A Qt Widget encapsulated CEF view based on QWidget
https://cefview.github.io/QCefView/
GNU Lesser General Public License v2.1
521 stars 137 forks source link

[BUG]: Unable to build on Mac 13.5 Ventura #341

Closed Armmegon closed 9 months ago

Armmegon commented 10 months ago

Trying to build QCefView on my MacBook M2 Max with MacOS 13.5 I get get this error:

[ 95%] Building CXX object QCefView/src/CMakeFiles/QCefView.dir/details/QCefConfigPrivate.cpp.o
In file included from /Users/venelin/Development/CEFTest/CEFTest/QCefView/src/details/QCefConfigPrivate.cpp:5:
In file included from /Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/QDir:1:
In file included from /Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/qdir.h:8:
/Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/qfile.h:59:58: error: 'path' is unavailable: introduced in macOS 10.15
inline QString fromFilesystemPath(const std::filesystem::path &path)
                                                         ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/usr/include/c++/v1/filesystem:909:24: note: 'path' has been explicitly marked unavailable here
class _LIBCPP_TYPE_VIS path {
                       ^
In file included from /Users/venelin/Development/CEFTest/CEFTest/QCefView/src/details/QCefConfigPrivate.cpp:5:
In file included from /Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/QDir:1:
In file included from /Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/qdir.h:8:
/Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/qfile.h:64:40: error: 'native' is unavailable: introduced in macOS 10.15
    return QString::fromStdString(path.native());
                                       ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/usr/include/c++/v1/filesystem:1193:22: note: 'native' has been explicitly marked unavailable here
  const string_type& native() const noexcept { return __pn_; }
                     ^
In file included from /Users/venelin/Development/CEFTest/CEFTest/QCefView/src/details/QCefConfigPrivate.cpp:5:
In file included from /Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/QDir:1:
In file included from /Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/qdir.h:8:
/Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/qfile.h:68:25: error: 'path' is unavailable: introduced in macOS 10.15
inline std::filesystem::path toFilesystemPath(const QString &path)
                        ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/usr/include/c++/v1/filesystem:909:24: note: 'path' has been explicitly marked unavailable here
class _LIBCPP_TYPE_VIS path {
                       ^
In file included from /Users/venelin/Development/CEFTest/CEFTest/QCefView/src/details/QCefConfigPrivate.cpp:5:
In file included from /Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/QDir:1:
In file included from /Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/qdir.h:8:
/Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/qfile.h:70:29: error: 'path' is unavailable: introduced in macOS 10.15
    return std::filesystem::path(reinterpret_cast<const char16_t *>(path.cbegin()),
                            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/usr/include/c++/v1/filesystem:909:24: note: 'path' has been explicitly marked unavailable here
class _LIBCPP_TYPE_VIS path {
                       ^
In file included from /Users/venelin/Development/CEFTest/CEFTest/QCefView/src/details/QCefConfigPrivate.cpp:5:
In file included from /Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/QDir:1:
In file included from /Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/qdir.h:8:
/Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/qfile.h:70:12: error: 'path<const char16_t *>' is unavailable: introduced in macOS 10.15
    return std::filesystem::path(reinterpret_cast<const char16_t *>(path.cbegin()),
           ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/usr/include/c++/v1/filesystem:953:3: note: 'path<const char16_t *>' has been explicitly marked unavailable here
  path(_InputIt __first, _InputIt __last, format = format::auto_format) {
  ^
In file included from /Users/venelin/Development/CEFTest/CEFTest/QCefView/src/details/QCefConfigPrivate.cpp:5:
In file included from /Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/QDir:1:
In file included from /Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/qdir.h:8:
/Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/qfile.h:70:12: error: 'path' is unavailable: introduced in macOS 10.15
    return std::filesystem::path(reinterpret_cast<const char16_t *>(path.cbegin()),
           ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/usr/include/c++/v1/filesystem:953:3: note: 'path' has been explicitly marked unavailable here
  path(_InputIt __first, _InputIt __last, format = format::auto_format) {
  ^
In file included from /Users/venelin/Development/CEFTest/CEFTest/QCefView/src/details/QCefConfigPrivate.cpp:5:
In file included from /Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/QDir:1:
In file included from /Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/qdir.h:8:
/Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/qfile.h:70:12: error: '~path' is unavailable: introduced in macOS 10.15
    return std::filesystem::path(reinterpret_cast<const char16_t *>(path.cbegin()),
           ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/usr/include/c++/v1/filesystem:968:3: note: '~path' has been explicitly marked unavailable here
  ~path() = default;
  ^
In file included from /Users/venelin/Development/CEFTest/CEFTest/QCefView/src/details/QCefConfigPrivate.cpp:5:
In file included from /Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/QDir:1:
In file included from /Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/qdir.h:8:
/Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/qfile.h:128:22: error: 'path' is unavailable: introduced in macOS 10.15
    std::filesystem::path filesystemFileName() const
                     ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/usr/include/c++/v1/filesystem:909:24: note: 'path' has been explicitly marked unavailable here
class _LIBCPP_TYPE_VIS path {
                       ^
In file included from /Users/venelin/Development/CEFTest/CEFTest/QCefView/src/details/QCefConfigPrivate.cpp:5:
In file included from /Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/QDir:1:
In file included from /Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/qdir.h:8:
/Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/qfile.h:190:22: error: 'path' is unavailable: introduced in macOS 10.15
    std::filesystem::path filesystemSymLinkTarget() const
                     ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/usr/include/c++/v1/filesystem:909:24: note: 'path' has been explicitly marked unavailable here
class _LIBCPP_TYPE_VIS path {
                       ^
In file included from /Users/venelin/Development/CEFTest/CEFTest/QCefView/src/details/QCefConfigPrivate.cpp:5:
In file included from /Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/QDir:1:
In file included from /Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/qdir.h:8:
/Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/qfile.h:195:29: error: 'path' is unavailable: introduced in macOS 10.15
    static std::filesystem::path filesystemSymLinkTarget(const T &fileName)
                            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/usr/include/c++/v1/filesystem:909:24: note: 'path' has been explicitly marked unavailable here
class _LIBCPP_TYPE_VIS path {
                       ^
In file included from /Users/venelin/Development/CEFTest/CEFTest/QCefView/src/details/QCefConfigPrivate.cpp:5:
In file included from /Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/QDir:1:
In file included from /Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/qdir.h:8:
/Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/qfile.h:129:14: error: '~path' is unavailable: introduced in macOS 10.15
    { return QtPrivate::toFilesystemPath(fileName()); }
             ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/usr/include/c++/v1/filesystem:968:3: note: '~path' has been explicitly marked unavailable here
  ~path() = default;
  ^
In file included from /Users/venelin/Development/CEFTest/CEFTest/QCefView/src/details/QCefConfigPrivate.cpp:5:
In file included from /Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/QDir:1:
In file included from /Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/qdir.h:8:
/Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/qfile.h:192:16: error: '~path' is unavailable: introduced in macOS 10.15
        return QtPrivate::toFilesystemPath(symLinkTarget());
               ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/usr/include/c++/v1/filesystem:968:3: note: '~path' has been explicitly marked unavailable here
  ~path() = default;
  ^
In file included from /Users/venelin/Development/CEFTest/CEFTest/QCefView/src/details/QCefConfigPrivate.cpp:5:
In file included from /Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/QDir:1:
In file included from /Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/qdir.h:9:
/Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/qfileinfo.h:82:22: error: 'path' is unavailable: introduced in macOS 10.15
    std::filesystem::path filesystemFilePath() const
                     ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/usr/include/c++/v1/filesystem:909:24: note: 'path' has been explicitly marked unavailable here
class _LIBCPP_TYPE_VIS path {
                       ^
In file included from /Users/venelin/Development/CEFTest/CEFTest/QCefView/src/details/QCefConfigPrivate.cpp:5:
In file included from /Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/QDir:1:
In file included from /Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/qdir.h:9:
/Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/qfileinfo.h:84:22: error: 'path' is unavailable: introduced in macOS 10.15
    std::filesystem::path filesystemAbsoluteFilePath() const
                     ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/usr/include/c++/v1/filesystem:909:24: note: 'path' has been explicitly marked unavailable here
class _LIBCPP_TYPE_VIS path {
                       ^
In file included from /Users/venelin/Development/CEFTest/CEFTest/QCefView/src/details/QCefConfigPrivate.cpp:5:
In file included from /Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/QDir:1:
In file included from /Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/qdir.h:9:
/Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/qfileinfo.h:86:22: error: 'path' is unavailable: introduced in macOS 10.15
    std::filesystem::path filesystemCanonicalFilePath() const
                     ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/usr/include/c++/v1/filesystem:909:24: note: 'path' has been explicitly marked unavailable here
class _LIBCPP_TYPE_VIS path {
                       ^
In file included from /Users/venelin/Development/CEFTest/CEFTest/QCefView/src/details/QCefConfigPrivate.cpp:5:
In file included from /Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/QDir:1:
In file included from /Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/qdir.h:9:
/Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/qfileinfo.h:100:22: error: 'path' is unavailable: introduced in macOS 10.15
    std::filesystem::path filesystemPath() const { return QtPrivate::toFilesystemPath(path()); }
                     ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/usr/include/c++/v1/filesystem:909:24: note: 'path' has been explicitly marked unavailable here
class _LIBCPP_TYPE_VIS path {
                       ^
In file included from /Users/venelin/Development/CEFTest/CEFTest/QCefView/src/details/QCefConfigPrivate.cpp:5:
In file included from /Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/QDir:1:
In file included from /Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/qdir.h:9:
/Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/qfileinfo.h:101:22: error: 'path' is unavailable: introduced in macOS 10.15
    std::filesystem::path filesystemAbsolutePath() const
                     ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/usr/include/c++/v1/filesystem:909:24: note: 'path' has been explicitly marked unavailable here
class _LIBCPP_TYPE_VIS path {
                       ^
In file included from /Users/venelin/Development/CEFTest/CEFTest/QCefView/src/details/QCefConfigPrivate.cpp:5:
In file included from /Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/QDir:1:
In file included from /Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/qdir.h:9:
/Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/qfileinfo.h:103:22: error: 'path' is unavailable: introduced in macOS 10.15
    std::filesystem::path filesystemCanonicalPath() const
                     ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/usr/include/c++/v1/filesystem:909:24: note: 'path' has been explicitly marked unavailable here
class _LIBCPP_TYPE_VIS path {
                       ^
In file included from /Users/venelin/Development/CEFTest/CEFTest/QCefView/src/details/QCefConfigPrivate.cpp:5:
In file included from /Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/QDir:1:
In file included from /Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/qdir.h:9:
/Users/venelin/Qt/6.6.0/macos/lib/QtCore.framework/Headers/qfileinfo.h:134:22: error: 'path' is unavailable: introduced in macOS 10.15
    std::filesystem::path filesystemSymLinkTarget() const
                     ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/usr/include/c++/v1/filesystem:909:24: note: 'path' has been explicitly marked unavailable here
class _LIBCPP_TYPE_VIS path {
                       ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[2]: *** [QCefView/src/CMakeFiles/QCefView.dir/details/QCefConfigPrivate.cpp.o] Error 1
make[1]: *** [QCefView/src/CMakeFiles/QCefView.dir/all] Error 2
make: *** [all] Error 2
☁  build  

Any idea why do I get this issue and how can I fix it ?

L-Super commented 10 months ago

It seems to be related to C++17's filesystem library. Check if your C++ compiler supports C++17 standard.

Armmegon commented 10 months ago

@L-Super I am not sure but they should be supporting it:

☁  cmake-build-release  gcc --version
Apple clang version 14.0.0 (clang-1400.0.29.202)
Target: arm64-apple-darwin22.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
☁  cmake-build-release  g++ --version
Apple clang version 14.0.0 (clang-1400.0.29.202)
Target: arm64-apple-darwin22.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
☁  cmake-build-release  
L-Super commented 9 months ago

Updating the QCefView code may solve this problem. You can see https://github.com/CefView/QCefView/discussions/329?sort=new#discussioncomment-7485042

Armmegon commented 9 months ago

@L-Super no difference at all. Still the exact same issue. This project is uncompilable on MacOS Sonoma 14.1

tishion commented 9 months ago
  1. std::filesystem::path is only supported from macOS 10.15+
  2. for Qt version < 6.5, Qt doesn't use std::filesystem::path so that it can support macOS version below 10.15
  3. starting from 6.5 Qt only supports for macOS 11+, and Qt uses std::filesystem::path

But QCefView still need to support macOS 10.13+, if you want to compile QCefView with Qt 6.5+, that means the minimum deployment target should be macOS 11.0+.

New commit to detect the deployment target: https://github.com/CefView/QCefView/commit/d8d134926d311bdc6412619774ebb7edd5d38d92

you can try it.

Armmegon commented 9 months ago

@tishion HA! Now it compiles. Thank you sir!

P.S. Another question anyone have tried to notarize this librariy as part of their app for Mac App store? Because QtWebEngine can't be notarised for Mac App Store.

Armmegon commented 9 months ago

@tishion thanks to your feedback and changes in the code I was able to build the project. However now it crashes and bare minimum implementation, please check this: https://github.com/CefView/QCefView/issues/351