boost::thread



  • hi!
    zuerst mal code mit dem error:

    include <boost/thread/thread.hpp>
    #include "Client.h"
    
    void SendMessage()
    {
    	while(1)
    	{
    		std::string message;
    
    		do{
    			std::getline(std::cin, message); 
    		}while(message.empty());
    
    		Client::getInstance().SendMessageToServer(message);
    	}
    }
    
    void ReceiveMessage()
    {
    	while(1)
    	{
    		Client::getInstance().receiveMessage();
    	}
    }
    
    void main()
    { 
        try
        {
    		#ifdef _WIN32
    		Winsock2Initializer winsock2initialization;
    		#endif
    
    		Client::getInstance().Login("pc");
    		Client::getInstance().receiveMessage();
    
    		boost::thread thrd1(&SendMessage);
                    thrd1.join();
    		boost::thread thrd2(&ReceiveMessage);
    		thrd2.join();
        }
    
        catch(const SocketException& socketException)
        {
    	socketException.show();
        }
    
       std::cin.get();
    }
    
    c:\Filetransfer\Chat_Client\main.cpp(51): error C2664: 'boost::thread::thread(const boost::function0<R,Allocator> &)' : Konvertierung des Parameters 1 von 'void (void)' in 'const boost::function0<R,Allocator> &' nicht möglich
            with
            [
                R=void,
                Allocator=int
            ]
            and
            [
                R=void,
                Allocator=int
            ]
    c:\Boost\include\boost\thread\thread.hpp(78): warning C4251: 'boost::thread_group::m_threads' : class 'std::list<_Ty,_Ax>' erfordert eine DLL-Schnittstelle, die von Clients von class 'boost::thread_group' verwendet wird
            with
            [
                _Ty=boost::thread *,
                _Ax=std::allocator<boost::thread *>
            ]
    c:\Boost\include\boost\thread\mutex.hpp(36): warning C4275: class 'boost::noncopyable' ist keine DLL-Schnittstelle und wurde als Basisklasse für die DLL-Schnittstelle class 'boost::mutex' verwendet
    c:\Boost\include\boost\thread\thread.hpp(38): warning C4275: class 'boost::noncopyable' ist keine DLL-Schnittstelle und wurde als Basisklasse für die DLL-Schnittstelle class 'boost::thread' verwendet
    c:\Boost\include\boost\thread\thread.hpp(67): warning C4275: class 'boost::noncopyable' ist keine DLL-Schnittstelle und wurde als Basisklasse für die DLL-Schnittstelle class 'boost::thread_group' verwendet
    c:\Boost\include\boost\thread\mutex.hpp(114): warning C4275: class 'boost::noncopyable' ist keine DLL-Schnittstelle und wurde als Basisklasse für die DLL-Schnittstelle class 'boost::timed_mutex' verwendet
    c:\Boost\include\boost\thread\mutex.hpp(74): warning C4275: class 'boost::noncopyable' ist keine DLL-Schnittstelle und wurde als Basisklasse für die DLL-Schnittstelle class 'boost::try_mutex' verwendet
    c:\Boost\include\boost\thread\exceptions.hpp(29): warning C4275: class 'std::logic_error' ist keine DLL-Schnittstelle und wurde als Basisklasse für die DLL-Schnittstelle class 'boost::lock_error' verwendet
    c:\Boost\include\boost\thread\exceptions.hpp(35): warning C4275: class 'std::runtime_error' ist keine DLL-Schnittstelle und wurde als Basisklasse für die DLL-Schnittstelle class 'boost::thread_resource_error' verwendet
    

    ich weiß nicht was da falsch sein soll;-((((((((8
    vielleicht weiß jemand um ratschlag...

    cu


Anmelden zum Antworten