boost:thread - compiler error

后端 未结 3 1495
刺人心
刺人心 2021-01-15 06:59

I wanted to use boost::thread in my program, but get the following compiler error (Visual Studio 2005):

Error   1   **error C2064**: term does not evaluate t         


        
3条回答
  •  孤街浪徒
    2021-01-15 07:06

    You are passing a member function to the thread object as the function to call when the thread starts. Since the thread doesn't have the object itself, it can't call the member function. You could make the hello function static, or look at the boost::bind library to send in the object.

提交回复
热议问题