dimanche 26 juin 2016

boost: linker(error C1001) error when using boost thread

I'm writing a program that uses boost::thread like below

class RPCClientManagment
{
    boost::thread *pThread_; 

    void RunSendRequestStatus()
    {
        boost::posix_time::seconds interval(30);
        while (bRunSendRequestStatus_)
        {
            SendRequestStatus();
            boost::this_thread::sleep(interval);
        }
    }

    void StartRequestStatus()
    {
        bRunSendRequestStatus_ = true;      
        pThread_ = new boost::thread(&RPCClientManagment::RunSendRequestStatus, this);  
    }
};

when I compile it in release mode I receive the following error:

1>c:program files (x86)boostboost_1_44boostasioplaceholders.hpp(91) : fatal error C1001: `An internal error has occurred in the compiler.`
1>(compiler file 'f:ddvctoolscompilerutcsrcp2main.c[0x62542D7F:0x00000028]', line 182)

1> To work around this problem, try simplifying or changing the program near the locations listed above.
1>Please choose the Technical Support command on the Visual C++ 
1> Help menu, or open the Technical Support help file for more information
1>LINK : fatal error LNK1000: Internal error during IMAGE::BuildImage
1>  Version 9.00.21022.08
1>  E
  • when I comment this row error message disappears
//pThread_ = new boost::thread(&RPCClientManagment::RunSendRequestStatus, this);  
  • In debug mode I don't see this problem at all.

NB: I'm using Visual Studio 2008

Aucun commentaire:

Enregistrer un commentaire