Return-Path: X-Original-To: apmail-hbase-user-archive@www.apache.org Delivered-To: apmail-hbase-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1D90C9318 for ; Mon, 4 Mar 2013 18:56:24 +0000 (UTC) Received: (qmail 22411 invoked by uid 500); 4 Mar 2013 18:56:21 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 22342 invoked by uid 500); 4 Mar 2013 18:56:21 -0000 Mailing-List: contact user-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hbase.apache.org Delivered-To: mailing list user@hbase.apache.org Received: (qmail 22330 invoked by uid 99); 4 Mar 2013 18:56:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Mar 2013 18:56:21 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of sergey@hortonworks.com designates 209.85.212.174 as permitted sender) Received: from [209.85.212.174] (HELO mail-wi0-f174.google.com) (209.85.212.174) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Mar 2013 18:56:17 +0000 Received: by mail-wi0-f174.google.com with SMTP id hi8so2461664wib.7 for ; Mon, 04 Mar 2013 10:55:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type:x-gm-message-state; bh=ZOMYlgmlAc5ztf+b/wXwta3ETevIeUKI8KI6CSZBIGE=; b=hqJNCRBMzF4aYIjQDkHPHmkzByl6pE2jXy1yHVE8HOlRlftwsikNCYjqiSfTMFhxKS ztifH4zjE/T//v+wzP4GX5z31V+MNU8jj/fk7DLa8Mgo/ugYjEIZ6ZK8wR0NGcizburs flxrkEWCplenEZ++AEo8UUL5B3QQFGc9TLm7aywXzP4sDg5n9PWfz2Zbqgwxq59KAyST BTGxAHN2R96FPzP9RWyntnkO7iyn0Pdo8S9+wrn6kWVBA8ONDfvrDtAodmBABuY1dQUc kWykVFZ4/0dReNL5qhaLfVYwhCG5hnwIXTTjDgGgtCzzY1+4WUMW7levyswsBxnoRioB ykWg== MIME-Version: 1.0 X-Received: by 10.194.123.130 with SMTP id ma2mr26120886wjb.46.1362423355949; Mon, 04 Mar 2013 10:55:55 -0800 (PST) Received: by 10.216.104.195 with HTTP; Mon, 4 Mar 2013 10:55:55 -0800 (PST) In-Reply-To: References: Date: Mon, 4 Mar 2013 10:55:55 -0800 Message-ID: Subject: Re: Any code example for access HBase using C++ except theout-of-date Democlient.cpp ? From: Sergey Shelukhin To: user@hbase.apache.org Content-Type: multipart/alternative; boundary=089e012287de2a4c6c04d71de83c X-Gm-Message-State: ALoCoQkD+8ld/W1bdISBqqxYNQ5OpvbZuRVwYhluJxMESI5HvOGTA2T4ABCQizv4ZiI5hncKVsBs X-Virus-Checked: Checked by ClamAV on apache.org --089e012287de2a4c6c04d71de83c Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable That looks correct. Do you want to file a JIRA and attach the patch? Otherwise I can do it later today/tomorrow. On Mon, Mar 4, 2013 at 1:29 AM, Kun Ling wrote: > Dear Sergey Shelukhin, > Thanks very much for your reply, and I have found out the reason. > I should put the -lthrift flag at the end of the command line, thanks > to the stackoverflow problem=EF=BC=9A > http://stackoverflow.com/questions/7337292/does-linking-switch-order-matt= ers > =E3=80=82 > > And according to my experience, a modification of Makefile is needed t= o > make DemoClient.cpp compile and run. Do you or some other ones have the > same problem? > > Thanks > > > yours, > Ling Kun > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D The modification =3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > diff --git a/hbase-examples/src/main/cpp/Makefile > b/hbase-examples/src/main/cpp/Makefile > index aab5951..30ffef4 100644 > --- a/hbase-examples/src/main/cpp/Makefile > +++ b/hbase-examples/src/main/cpp/Makefile > @@ -28,7 +28,7 @@ GEN_SRC =3D ./gen-cpp/Hbase.cpp \ > default: DemoClient > > DemoClient: DemoClient.cpp > - g++ -o DemoClient -I${THRIFT_DIR} -I./gen-cpp -L${LIB_DIR} > -Wl,-rpath,${LIB_DIR} -lthrift DemoClient.cpp ${GEN_SRC} > + g++ -o DemoClient -I${THRIFT_DIR} -I./gen-cpp -L${LIB_DIR} > -Wl,-rpath,${LIB_DIR} DemoClient.cpp ${GEN_SRC} -lthrift > > clean: > rm -rf DemoClient > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > > > ------------------ Original ------------------ > From: "Sergey Shelukhin"; > Date: Tue, Feb 26, 2013 03:30 AM > To: "user"; > > Subject: Re: Any code example for access HBase using C++ except > theout-of-date Democlient.cpp ? > > > > At some point few months ago, I think I was able to make cpp sample from > trunk compile and link (against trunk). > I think one of the problems on the way was that some HBase thrift classes > got renamed between versions of thrift used before and after (in your cas= e, > 94 and current trunk). > Can you check the thrift generated code, thrift headers you use to compil= e, > and thrift you are actually linking against, for, respectively, usage, > declaration and definition of this ctor? > I am not sure how, you might be compiling against thrift headers of one > version but linking against a different one... > > On Sun, Feb 24, 2013 at 5:19 PM, Kun Ling wrote: > > > Dear All, > > I am writing for some C++ code example for using HBase. > > > > After Google and look into the HBase Document, I found that C++ cod= e > > can connect to HBase using Thrift Interface. > > > > However, when compile the DemoClient.cpp within the latest HBase > > release package, it seems that this file is out of date(plenty of APIs > need > > a new std::map & attributes parameter ). > > > > And I have also tried to replace the DemoClient.cpp with the lates= t > > trunk version. However, after some modification there are still link > > problems when compile the code( undefined reference to > > `apache::thrift::transport::TSocket::TSocket(std::string, int)', I have > > passed the -lthrift parameter to gcc). > > > > Is there anyone who can kindly show some can-work C++ code for HBase > > connection? Or does anyone have any experience on this error? > > > > > > Thanks. > > Kun Ling > --089e012287de2a4c6c04d71de83c--