lundi 3 avril 2017

CLion cannot resolve thread

I'm writing a Multithreading program based on C++ 11 using "JetBrains CLion 2017.1". The code is here:

#include <stdlib.h>
#include <iostream>
#include <thread>

void thread_task() {
    std::cout << "hello thread" << std::endl;
}

int main(int argc, const char *argv[])
{
    std::thread t(thread_task);
    t.join();

    return EXIT_SUCCESS;
}

And the "CMakeLists.txt" is default:

cmake_minimum_required(VERSION 3.7)
project(AgileDev)

set(CMAKE_CXX_STANDARD 11)

set(SOURCE_FILES main.cpp)
add_executable(AgileDev ${SOURCE_FILES})

But CLion cannot resolve "thread": Error picture

I wondered where I was wrong. (T^T)

Aucun commentaire:

Enregistrer un commentaire