Problem with includes lib

  • Hi Qt Developer Network!
    I have some truble with include standart lib.
    I include standart randome lib:
    #include <random>

    when I include this lib Qt creator detects not error, but when I compile it Qt say it:

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

  • Hi and welcome to the DevNet forums,

    Did you use c++11 in your pro file?

    See "This wiki":

    For instructions.

    I think random was not in the standard libs untill c++11 an Qt Creator doesn,t use c++11 by default yet.

    Hope it helps.

  • It's does't work.

    My file *.pro:
    TEMPLATE = app
    CONFIG += console
    CONFIG -= app_bundle
    CONFIG += qt
    CONFIG += c++11
    #QMAKE_CXXFLAGS += -std=c++0x // for GCC < 4.7
    QMAKE_CXXFLAGS += -std=c++11 // for GCC >= 4.7

    SOURCES += main.c

    error: No such file or directory

Log in to reply