c++ - Qt 创建者的 std::filesystem 链接器错误
问题描述
首先,是的,我看到了这个话题: How to Avoid std::filesystem linker errors with Qt?
我有我的 c++ 项目,在那里我使用了 std::filesystem 。我可以用 cmd ( g++ (GCC) 9.2.0 ) 编译它,例如:
g++ -std=c++17 -Wall -Wconversion-null -c client.cpp -o c.o -lstdc++fs
但有了这个 .pro 文件:
LIBS += -lws2_32
LIBS += -lstdc++fs
QT -= gui
CONFIG += c++17
CONFIG -= app_bundle
QMAKE_LFLAGS += -lstdc++fs
DEFINES += QT_DEPRECATED_WARNINGS
SOURCES += \
client.cpp \
logmsg.cpp \
main.cpp
# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
HEADERS += \
client.h \
includes.h
我不能这样做,我不明白为什么。
错误:
filesystem: No such file or directory
#include <filesystem>
^~~~~~~~~~~~
解决方案
推荐阅读
- apache-spark - InsertInto(tablename) 始终将 Dataframe 保存在 Hive 的默认数据库中
- ios - 在设备上运行 Flutter iOS 应用程序会引发“线程 1:信号 SIGABRT”错误并崩溃
- python - PermissionError:[Errno 13] 权限被拒绝:output.csv
- android - 如何在 Android 上停止 Kotlin 协程?
- r - XGBoost Regression H2o R 的 RMSE 的 Boostrapped 直方图(如何提高效率)
- amazon-web-services - Cloudwatch 警报不会离开警报状态,也不会重新触发
- azure - 如何在 U-SQL 提取语句中指定日期范围
- c# - Mono c# 获取类
- powershell - 当 powershell 脚本作为作业运行时无法读取 Outlook 电子邮件
- swift - ARKit – 如何将 PNG 文件转换为 OBJ 文件?