I am unable to compile C++ thread library on my Ubuntu Linux system. With every option I give while compiling I always get this error
Either I compile giving
alc:~/practice/C++$ g++ -o thr thr.cpp -lpthread -std=c++11
or
alc:~/practice/C++$ g++ -o thr thr.cpp -std=c++0x -lpthread
In file included from thr.cpp:3:0:
/usr/include/c++/4.9/thread: In constructor ‘std::thread::thread(_Callable&&, _Args&& ...)’:
/usr/include/c++/4.9/thread:138:46: error: ‘__bind_simple’ is not a member of ‘std’
         _M_start_thread(_M_make_routine(std::__bind_simple(
                                              ^~~~~~~~~~~~~
/usr/include/c++/4.9/thread:138:46: note: suggested alternative: ‘__big_div_impl’
         _M_start_thread(_M_make_routine(std::__bind_simple(
                                              ^~~~~~~~~~~~~
                                              __big_div_impl
This is my C++ program
#include <c++/4.9/iostream>
#include <c++/4.9/thread>
using namespace std;
void func_dummy(int N)
{
    for(int i=0 ; i < N ; i++)
        cout << "Thread 1 : function pointer" << endl;
}
int main()
{
    thread thr1(func_dummy, 2);
    thr1.join();
    return 0;
}
 
    