пробую вызвать this_thread::get_id()
Но получаю ошибку has not been declared
Кто может помочь почему так?
Шли код, поглядим...
this_thread из std)
И сообщения об ошибках
cout << std::this_thread::get_id() << endl; error: 'std::this_thread' has not been declared
Шли ВЕСЬ код. А не куски
Много - в pastebin.com или аналоги
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow){ // стандартный код инициализации окна // ----------------------------------------- cout << std::this_thread::get_id() << endl; // ----------------------------------------- while(GetMessage(&msg, NULL, 0, 0)){ TranslateMessage(&msg); DispatchMessage(&msg); } return msg.wParam; }
тут нет includes. шли весь минимальный компилдируемый пример
А ничего, что у виндового приложения вообще stdin нету?
но ладно, где инклюды ?Нет - ну и значить std нет...
#include <iostream> #include <windows.h> #include <fstream> #include <string> #include <conio.h> #include <stdlib.h> #include <iomanip> #include <limits> #include <sstream> #include <stdio.h> #include <clocale> #include <thread> using namespace std; using namespace Gdiplus;
Оберните код в теги: 3 символа ` до и после кода (в случае одиночной конструкции достаточно 1 ` с обеих сторон). Спасибо!
Обсуждают сегодня