Boost Asio - Unresolved external symbol.

I have this code :

TServer.cpp
1
2
3
4
5
void TServer::Accept_Connection()
{
    const std::shared_ptr<TSession> Connection = std::make_shared<TSession>(acceptor.get_io_service());
    acceptor.async_accept(*(Connection->Socket()), boost::bind(&TServer::Handle_Connection, this, Connection, boost::asio::placeholders::error));
}

TSocket.cpp
1
2
3
4
5
6
7
8
9
10
TSocket::TSocket(boost::asio::io_service &io_service) :
sock_ptr(std::make_shared<boost::asio::ip::tcp::socket>(io_service))
{

}

std::shared_ptr<boost::asio::ip::tcp::socket> TSocket::Get()
{
    return sock_ptr;
}

And when i try to debug it i get:

error LNK2019: unresolved external symbol "public: class std::shared_ptr > > __thiscall TSession::Socket(void)" (?Socket@TSession@@QAE?AV?$shared_ptr@V?$basic_stream_socket@Vtcp@ip@asio@boost@@V?$stream_socket_service@Vtcp@ip@asio@boost@@@34@@asio@boost@@@std@@XZ) referenced in function "public: void __thiscall TServer::Accept_Connection(void)" (?Accept_Connection@TServer@@QAEXXZ)

Idk why . What's wrong ? It's hard to fix unresolved external errors cause i can't resolve what this error means..
Last edited on
Topic archived. No new replies allowed.