使用boost asio.hpp编译错误

时间:2015-10-19 19:43:43

标签: c++ boost

当我将boost / asio.hpp包含到我的源文件并编译时,我收到此错误:

// Controller's save action
@Transactional
def save() {
    def baseUrl = baseUrl()

    params.createdBy = currentUser()
    params.contactEmail = userEmail()

    Item item = new Item( params )

    if ( params.group) {
        itemService.bindItemPropertyData( item, params )
    }

    if ( !item.validate() ) {
        if ( item.isSpecialConstraintViolation() ) {
            def duplicatedItemUrl = itemAssetService.getDuplicatedItemUrl( item.source, baseUrl )

            render view: 'create', model: [ item : item,
                                            map             : getListsForView(),
                                            duplicatedSource: duplicatedAssetUrl,
                                            referer         : params.referer,
                                            params          : params ]
        } else {
            render view: 'create', model: [ item: item,
                                            map           : getListsForView(),
                                            referer       : params.referer,
                                            params        : params ]
        }
    } else {
        if ( params.referer ) {
            item.save( flush: true )
            redirect( uri: params.referer )
        } else {
            item.save( flush: true )
            redirect( action: "show", id: item.id )
        }
    }
}

// requestReferer() method in controller
private String requestReferer() {
    return request.getHeader("referer")
}

// Geb login method
def logIn() {
    $("form").username = "user"
    $("form").password = "password"
    $("button").click()
}

// geb test in question
def "test creating an item"() {
    when: "logging in and creating an item"
        go '/'
        logIn()
        go '/item/create'
        $("form").name = "Item One"
        $("form").source = "Item One"
        $("button").click()

    then: "item was saved"
        $("title").text() == "Item Index"
}

可以看出,我使用gcc 4.3.2在Suse Linux 2.6.31.14-0.8下进行编译。我试过了

  1. 复合体中的第558行具有" ... = std :: max(abs(__ x),abs(__ y));"。因此我尝试添加#undef max和#undef abs来查看它是否有用。它没有帮助
  2. 我尝试过有条理地包含BOOST_ALL_NO_LIB但它没有帮助。
  3. 任何解决这个问题的方法都表示赞赏。

    这是复杂的完整函数,它给出了错误:

    In file included from /usr/include/boost/type_traits/is_complex.hpp:12,
                 from /usr/include/boost/type_traits.hpp:81,
                 from /usr/include/boost/asio/detail/wrapped_handler.hpp:21,
                 from /usr/include/boost/asio/io_service.hpp:39,
                 from /usr/include/boost/asio/basic_io_object.hpp:20,
                 from /usr/include/boost/asio/basic_socket.hpp:24,
                 from /usr/include/boost/asio/basic_datagram_socket.hpp:25,
                 from /usr/include/boost/asio.hpp:20,
                 from Source.cpp:166:
    /usr/local/lib/gcc/x86_64-suse-linux/4.3.2/include/c++/complex: In function ‘_Tp std::__complex_abs(const std::complex<T>&)’:
    /usr/local/lib/gcc/x86_64-suse-linux/4.3.2/include/c++/complex:558: error: expected unqualified-id before ‘(’ token
    

0 个答案:

没有答案