- Created Tuesday, March 22nd 2016 @ 02:34:49
Hi all, any chance we can get posix threading for C/C++ enabled (linked)?
DeveloperCreated Tuesday, March 22nd 2016 @ 09:01:20
No, this library (for now) won't be added to the C/C++ compiler.
- Created Thursday, March 31st 2016 @ 03:32:10
I don't necessarily care about posix threading specifically, but am wondering about std::thread & co? I uploaded a bot and am getting the following compilation errors:
error: ‘mutex’ in namespace ‘std’ does not name a type error: ‘lock_guard’ is not a member of ‘std’
Any advice appreciated. Cheers
- Created Thursday, March 31st 2016 @ 04:10:31
Sorry, I was confused. I guess std::thread does depend on pthread when compiled on linux? My compiler was just linking it for me behind the scenes. I replaced my mutex with a spinlock and now the server gives this error when compiling my bot:
/tmp/cchjvxoa.o: In function `std::thread::thread(void (&)())': main.cpp:(.text._ZNSt6threadC2IRFvvEIEEEOT_DpOT0_[_ZNSt6threadC5IRFvvEIEEEOT_DpOT0_]+0x9): undefined reference to `pthread_create' /usr/lib/gcc/x86_64-linux-gnu/4.9/libstdc++.a(thread.o): In function `std::thread::_M_start_thread(std::shared_ptr)': (.text._ZNSt6thread15_M_start_threadESt10shared_ptrINS_10_Impl_baseEE+0x6d): undefined reference to `pthread_create' collect2: error: ld returned 1 exit status