Code::Blocks Forums
		User forums => Help => Topic started by: Salih2003 on May 21, 2022, 02:41:55 pm
		
			
			- 
				Hello. I was learning the thread library of c++. I wrote a code like this.
 #include <iostream>
 #include <thread>
 #include <clocale>
 using namespace std;
 
 void print(string message)
 {
 cout << message << endl;
 }
 
 
 int main()
 {
 thread th1(print,"test");
 setlocale(LC_ALL,"Turkish");
 print("sssssssssss");
 th.join();
 return 0;
 }
 
 C++17 flag is raised. However, I am getting an error like this:
 
 ||==== Build: Debug in console (compiler: GNU GCC Compiler) ===|
 C:\ProgramData\Microsoft\Windows\Start Menu\Programs\CodeBlocks\console\main.cpp||In function 'int main()':|
 C:\ProgramData\Microsoft\Windows\Start Menu\Programs\CodeBlocks\console\main.cpp|14|error: 'thread' was not declared in this scope|
 C:\ProgramData\Microsoft\Windows\Start Menu\Programs\CodeBlocks\console\main.cpp|4|note: 'std::thread' is defined in header '<thread>'; did you forget to '#include <thread>'?|
 C:\ProgramData\Microsoft\Windows\Start Menu\Programs\CodeBlocks\console\main.cpp|17|error: 'th' was not declared in this scope; did you mean 'tm'?|
 ||==== Build failed: 2 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===
 
 Why is this problem?
 my computer system:
 intel core i2 duo 32bit
 3gb ram
 windows 7
 GPU: none.
 Since I don't know English, I used google translate.
- 
				This should help: http://forums.codeblocks.org/index.php/topic,9996.0.html
			
- 
				This should help: http://forums.codeblocks.org/index.php/topic,9996.0.html
 
 ...this is true.
 
 Please ask such questions not in the forum that is dedicated to the development of the IDE "Code::Blocks" but in a standard C/C++ forum.
 
 Topic locked.