From users-return-10492-apmail-qpid-users-archive=qpid.apache.org@qpid.apache.org Fri May 2 11:32:58 2014 Return-Path: X-Original-To: apmail-qpid-users-archive@www.apache.org Delivered-To: apmail-qpid-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EF598106A8 for ; Fri, 2 May 2014 11:32:57 +0000 (UTC) Received: (qmail 89402 invoked by uid 500); 2 May 2014 11:32:57 -0000 Delivered-To: apmail-qpid-users-archive@qpid.apache.org Received: (qmail 89379 invoked by uid 500); 2 May 2014 11:32:56 -0000 Mailing-List: contact users-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@qpid.apache.org Delivered-To: mailing list users@qpid.apache.org Received: (qmail 89370 invoked by uid 99); 2 May 2014 11:32:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 May 2014 11:32:56 +0000 X-ASF-Spam-Status: No, hits=-5.0 required=5.0 tests=RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of gsim@redhat.com designates 209.132.183.28 as permitted sender) Received: from [209.132.183.28] (HELO mx1.redhat.com) (209.132.183.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 May 2014 11:32:50 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s42BWSv8006970 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 2 May 2014 07:32:28 -0400 Received: from [10.36.116.92] (ovpn-116-92.ams2.redhat.com [10.36.116.92]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s42BWRWk020358 for ; Fri, 2 May 2014 07:32:28 -0400 Message-ID: <536382F7.6070400@redhat.com> Date: Fri, 02 May 2014 12:35:19 +0100 From: Gordon Sim Organization: Red Hat UK Ltd, Registered in England and Wales under Company Registration No. 3798903, Directors: Michael Cunningham (USA), Matt Parsons (USA), Charlie Peters (USA), Michael O'Neill (Ireland) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: users@qpid.apache.org Subject: Re: compile qpid program with C++0X thread failed References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Virus-Checked: Checked by ClamAV on apache.org On 05/02/2014 12:23 PM, An Yang wrote: > Hi all, > > I'm using CentOS 6.5, and write a demo program with C++0x thread, it should > create sender and receiver thread, but I got the followings: > $g++ -std=c++0x -pthread qpid-thread.cpp -o qpid-thread -lqpidmessaging > qpid-thread.cpp: In function 'void qpid::tests::qpidReceive()': > qpid-thread.cpp:27: error: no matching function for call to > 'qpid::messaging::Receiver::fetch(qpid::messaging::Message&, int)' > /usr/include/qpid/messaging/Receiver.h:78: note: candidates are: bool > qpid::messaging::Receiver::fetch(qpid::messaging::Message&, > qpid::messaging::Duration) > /usr/include/qpid/messaging/Receiver.h:90: note: > qpid::messaging::Message > qpid::messaging::Receiver::fetch(qpid::messaging::Duration) You need to pass a qpid::messaging::Duration object as the second parameter to fetch(), e.g. > Connection connection; > try { > connection = Connection("ampq:tcp:localhost"); > connection.open(); > Session session = connection.createSession(); > Receiver receiver = session.createReceiver("benchmark"); > receiver.setCapacity(1000); > Message msg; > if (receiver.fetch(msg, 0)) > std::cout << "got a message" << std::endl; if (receiver.fetch(qpid::messaging::Duration::IMMEDIATE) > session.commit(); > session.acknowledge(); > session.close(); > connection.close(); > } catch(const std::exception& error) { > std::cerr << "qpid-receive: " << error.what() << std::endl; > connection.close(); > } > } > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org For additional commands, e-mail: users-help@qpid.apache.org