I have defined a class and it's implementation in 2 seperate files, as the following:
(Server.h & Server.cpp are in a different project, and main.cpp is on a different one under one single solution - Visual Studio 2008)
Server.cpp:
Code:
Networking::Server::Server(boost::asio::io_service& io_service_, tcp::endpoint& serverEndpoint) :
io_service(io_service_), conAcceptor(io_service_, serverEndpoint)
{
this->BeginAccept();
}
some other code in here.
Server.h:
Code:
namespace Networking
{
class Server
{
some other code...
public:
Server(boost::asio::io_service& io_service_, tcp::endpoint& serverEndpoint);
some other code...
};
}
and main.cpp:
Code:
boost::asio::io_service io;
Networking::Server server(io, boost::asio::ip::tcp::endpoint(boost::asio::ip::tcp::v4(), 5555));
boost::thread(boost::bind(&boost::asio::io_service::run, &io));
When I try to compile it says that there's an unresolved external:
Code:
main.obj : error LNK2019: unresolved external symbol "public: __thiscall Networking::Server::Server(class boost::asio::io_service &,class boost::asio::ip::basic_endpoint<class boost::asio::ip::tcp> &)" (??0Server@Networking@@QAE@AAVio_service@asio@boost@@AAV?$basic_endpoint@Vtcp@ip@asio@boost@@@ip@34@@Z) referenced in function _main
C:\Documents and Settings\ניב\שולחן העבודה\DESKTOP 10\RemoteDesktopBoost\Debug\FileSharing.exe : fatal error LNK1120: 1 unresolved externals
I seriously have no idea what is the problem in here, and I wouldn't care for some help.
Thanks in advance.