解决方案 »

  1.   

    把#include "hudp.h"注释掉就可以顺利编译
      

  2.   

    #include "StdAfx.h"
    #include "hudp.h"
    hudp::hudp(void)
    {
    }
    hudp::~hudp(void)
    {
    }
    void hudp::debug001(void)
    {
        boost::asio::io_service io_service;  
        boost::asio::ip::udp::socket udp_socket(io_service);  
        boost::asio::ip::udp::endpoint local_add(boost::asio::ip::address::from_string("127.0.0.1"), 7474);  
      
        udp_socket.open(local_add.protocol());  
        udp_socket.bind(local_add);  
      
        char receive_buffer[10] = {0};  
        while (true)  
        {  
            boost::asio::ip::udp::endpoint send_point;  
            udp_socket.receive_from(boost::asio::buffer(receive_buffer, 10), send_point);  
            cout << "recv:" << receive_buffer << endl;  
            udp_socket.send_to(boost::asio::buffer(receive_buffer), send_point);  
      
            memset(receive_buffer, 0, 10);  
        }  
    }
      

  3.   

    1>c:\open_source\boost\include\boost-1_55\boost\integer_traits.hpp(96): error C2766: 显式专用化;已定义“boost::integer_traits<unsigned char>”
    1>          c:\open_source\boost\include\boost-1_55\boost\integer_traits.hpp(76) : 参见“integer_traits<unsigned char>”的前一个定义
    1>c:\open_source\boost\include\boost-1_55\boost\type_traits\is_integral.hpp(37): error C2766: 显式专用化;已定义“boost::is_integral<unsigned char>”
    1>          c:\open_source\boost\include\boost-1_55\boost\type_traits\is_integral.hpp(27) : 参见“is_integral<unsigned char>”的前一个定义
    1>c:\open_source\boost\include\boost-1_55\boost\type_traits\is_integral.hpp(37): error C2766: 显式专用化;已定义“boost::is_integral<const unsigned char>”
    1>          c:\open_source\boost\include\boost-1_55\boost\type_traits\is_integral.hpp(27) : 参见“is_integral<unsigned char const >”的前一个定义
    1>c:\open_source\boost\include\boost-1_55\boost\type_traits\is_integral.hpp(37): error C2766: 显式专用化;已定义“boost::is_integral<volatile unsigned char>”
    1>          c:\open_source\boost\include\boost-1_55\boost\type_traits\is_integral.hpp(27) : 参见“is_integral<unsigned char volatile >”的前一个定义
    1>c:\open_source\boost\include\boost-1_55\boost\type_traits\is_integral.hpp(37): error C2766: 显式专用化;已定义“boost::is_integral<volatile const unsigned char>”
    1>          c:\open_source\boost\include\boost-1_55\boost\type_traits\is_integral.hpp(27) : 参见“is_integral<unsigned char const volatile >”的前一个定义
      

  4.   

    we only #include one time!
      

  5.   

    我只include了一次啊,所以感觉非常古怪
    而且hudp.h里面有防止多次include的部分#pragma once
    #ifndef __HUDP_H_
    #define __HUDP_H_
    。。
    #endif