Boost logo

Boost :

From: ghq7613 (ghq7613_at_[hidden])
Date: 2005-08-16 09:36:19


Hi.
i just test using giallo .but it has some errors:

giallo error LNK2005: "public: __thiscall std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char>
>::~basic_string<char,struct std::char_traits<char>,class
std::allocator<char> >(void)"
(??1?$basic_string_at_DU?$char_traits_at_D@std@@V?$allocator_at_D@2@@std@@QAE_at_XZ)
已经在 giallo.obj 中定义


// giallo.cpp : ¶¨Òå¿ØÖÆ̨ӦÓóÌÐòµÄÈë¿Úµã¡£
//
#include "stdafx.h"

#include <string>
#include <boost/net/socket/socket.hpp>
#include <boost/net/socket/ip4.hpp>

void server();

int _tmain(int argc, _TCHAR* argv[])
{
        server();
        return 0;
}

void server() {
        boost::net::socket::socket socket;
        boost::net::socket::socket_errno err;
        boost::net::socket::ip4::tcp_protocol protocol;
        boost::net::socket::ip4::address addr;
        addr.port(3235);
        addr.ip("127.0.0.1");

        err=socket.open(protocol, boost::net::blocking_synchronisation() );
        std::cout<<"opened-"<<err<<std::endl;
        err=socket.bind(addr);
        std::cout<<"bind-"<<err<<std::endl;
        err=socket.listen();
        std::cout<<"listen-"<<err<<std::endl;
        boost::net::socket::socket connection;
        err=socket.accept(connection, addr);
        char buf[100];
        int n=connection.recv(buf,100);
}


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk