当我将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下进行编译。我试过了
任何解决这个问题的方法都表示赞赏。
这是复杂的完整函数,它给出了错误:
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