CefView / QCefView

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

[BUG]: macOS 系统 Qt6.5 环境编译报错 (std::filesystem::path) #265

Closed fancyop closed 1 year ago

fancyop commented 1 year ago

Describe the bug 【Bug描述】

macOS 系统 Qt6.5环境编译报错

To Reproduce 【复现步骤】

  1. 克隆代码
    git clone --recursive https://github.com/CefView/QCefView.git
  2. 配置编译环境
    cd QCefView
    export QTDIR=~/Qt-6.5/6.5.1/macos
  3. 编译
    ./generate-mac-x86_64.sh
    cmake --build .build/macos.x86_64

Expected behavior 【正确的预期行为】

cmake过程编译失败,输出内容

** BUILD FAILED **

In file included from /Users/XXXX/Qt-6.5/6.5.1/macos/lib/QtCore.framework/Headers/qdir.h:8:
/Users/XXXX/Qt-6.5/6.5.1/macos/lib/QtCore.framework/Headers/qfile.h:31:58: error: 
      'path' is unavailable: introduced in macOS 10.15
inline QString fromFilesystemPath(const std::filesystem::path &path)
                                                         ^
In file included from /Users/XXXX/workspace/QCefView/src/details/QCefSettingPrivate.cpp:6:
In file included from /Users/XXXX/Qt-6.5/6.5.1/macos/lib/QtCore.framework/Headers/QDir:1:
In file included from /Users/XXXX/Qt-6.5/6.5.1/macos/lib/QtCore.framework/Headers/qdir.h:8:
In file included from /Users/XXXX/Qt-6.5/6.5.1/macos/lib/QtCore.framework/Headers/qfile.h:13:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.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/XXXX/workspace/QCefView/src/details/QCefSettingPrivate.cpp:6:
In file included from /Users/XXXX/Qt-6.5/6.5.1/macos/lib/QtCore.framework/Headers/QDir:1:
In file included from /Users/XXXXQt-6.5/6.5.1/macos/lib/QtCore.framework/Headers/qdir.h:8:
/Users/XXXX/Qt-6.5/6.5.1/macos/lib/QtCore.framework/Headers/qfile.h:36:40: error: 
      'native' is unavailable: introduced in macOS 10.15
    return QString::fromStdString(path.native());

。。。。省略

The following build commands failed:
    CompileC /Users/XXXX/workspace/QCefView/.build/macos.x86_64/build/QCefView.build/Debug/Objects-normal/x86_64/QCefSettingPrivate.o /Users/XXXX/workspace/QCefView/src/details/QCefSettingPrivate.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'QCefView' from project 'QCefView')
(1 failure)

...

Screenshots 【截图】

...

Environment 【BUG产生的环境】

tishion commented 1 year ago

这个应该是Qt的问题

Armmegon commented 10 months ago

Did you managed to solved that issue @tishion @fancyop ?

fancyop commented 10 months ago

Did you managed to solved that issue @tishion @fancyop ?

You can try to solve it by referring to the following steps.

https://blog.csdn.net/fancyop/article/details/132687223

Armmegon commented 10 months ago

@fancyop I tried but still no difference. Did you managed to solve it, if so how? This article was on a Chinese language maybe I am not sure, can you please give some brief guidance if you managed to solve it ?