0

First, yes, I saw this topic: How to avoid std::filesystem linker errors with Qt?

I have my c++ project and there I used a std::filesystem .I can compile it with cmd ( g++ (GCC) 9.2.0 )and for example:

g++ -std=c++17 -Wall -Wconversion-null -c client.cpp -o c.o -lstdc++fs

but with this .pro file:

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

I cannot do it and I cannot understand why.

Error:

   filesystem: No such file or directory
    #include <filesystem>

          ^~~~~~~~~~~~
Adrian Mole
  • 49,934
  • 160
  • 51
  • 83
  • 1
    The mentioned error is not a linkage error. Compiler fails to find the include file. Might be a wrong compiler version. Can you show the code where the filesystem header included? – vahancho Apr 29 '20 at 08:18
  • Which QMake/Qt version is this? The full argument list of the failing g++ call might also be interesting (to see where it differs from your manual call). – Frank Osterfeld Apr 29 '20 at 11:45
  • @vahancho totally right ,choosed wrong compiler version in kits' settings. Thanks for help. – Gaurav Goswami Apr 29 '20 at 13:25

0 Answers0