[ 
https://issues.apache.org/jira/browse/THRIFT-4649?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16644539#comment-16644539
 ] 

Erik edited comment on THRIFT-4649 at 10/10/18 7:03 AM:
--------------------------------------------------------

Thank you, I indeed had added the 
{code:java}
... -levent ... 
{code}
and had double checked libevent-dev was present (it is).  Yet the error is the 
same.  I may try on a fresh system again.. or in a docker container.

However, I don't even want a non-blocking server...leading me to wonder, do I 
have to indicate that in the "myservice.thrift" service description so that the 
generated skeleton uses blocking server implementations... or do I simply lift 
the sample Server from the 0.10.0 branch tutorial and attempt to compile that?  
I ask because the skeleton looked a little different from the sample file(s) in 
the tutorial


was (Author: emcp):
Thank you, I indeed had added the 
{code:java}
... -levent ... 
{code}
and had double checked libevent-dev was present (it is).  Yet the error is the 
same.  I may try on a fresh system again.. or in a docker container.

However, I don't even want a non-blocking server...leading me to wonder, do I 
have to indicate that in the .thrift service description so that the generated 
skeleton uses blocking server implementations... or do I simply lift the sample 
Server from the 0.10.0 branch tutorial and attempt to compile that?  I ask 
because the skeleton looked a little different from the sample file(s) in the 
tutorial

> Error when attempting to link Thrift Server in C++ 
> ---------------------------------------------------
>
>                 Key: THRIFT-4649
>                 URL: https://issues.apache.org/jira/browse/THRIFT-4649
>             Project: Thrift
>          Issue Type: Question
>          Components: C++ - Compiler
>    Affects Versions: 0.10.0
>         Environment: Ubuntu 18.04 LTS with all prerequisites on latest from 
> apt install
>            Reporter: Erik
>            Assignee: James E. King III
>            Priority: Major
>
> I am attempting to compile Thrift with a particular flag .. in this case
> {code:java}
> ./configure _GLIBCXX_USE_CXX11_ABI=0{code}
> This compiles just fine, and the library installs successfully to 
> /usr/local/lib, but when I am attempting to link it seems to want the 
> non-blocking library.. I've attempted to add it to no avail
>   
>  
> {code:java}
> #!/bin/sh
> echo "Step 1: change to build dir"
> cd build
> echo "Step 2: compile"
> g++ -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11 -c ../src/Server/MyServer.cpp 
> ../src/gen-cpp/*.cpp -std=c++11 -I/usr/local/include/thrift 
> -I../deps/another_lib/Includes
> echo "Step 3: link"
> g++ -DHAVE_INTTYPES_H -DHAVE_NETINET_IN_H -std=c++11 -Wall *.o 
> -L../deps/another_lib -L../deps/libone -L../deps/libtwo -lanother_lib 
> -L/usr/local/lib -lthrift -lthriftnb -llogger -lanotherlogger -lpthread -o 
> My-Cpp-Server
> echo "Step 4: change back dirs"
> cd ..
> {code}
>  
> It feels like it is attempting to link, but cannot see the non-blocking 
> library.. 
>  
> {code:java}
> virtual-machine:~/Dev/git/project$ sh build-cpp-server.sh
> Step 1: change to build dir
> Step 2: compile
> Step 3: link
> Rio.o: In function `rio::RioConcurrentClient::recv_init(int)':
> Rio.cpp:(.text+0x3293): undefined reference to 
> `apache::thrift::async::TConcurrentClientSyncInfo::getPending(std::string&, 
> apache::thrift::protocol::TMessageType&, int&)'
> Rio.cpp:(.text+0x360e): undefined reference to 
> `apache::thrift::async::TConcurrentClientSyncInfo::updatePending(std::string 
> const&, apache::thrift::protocol::TMessageType, int)'
> Rio.o: In function `rio::RioConcurrentClient::recv_manipulate_can(int)':
> Rio.cpp:(.text+0x39d2): undefined reference to 
> `apache::thrift::async::TConcurrentClientSyncInfo::getPending(std::string&, 
> apache::thrift::protocol::TMessageType&, int&)'
> Rio.cpp:(.text+0x3d37): undefined reference to 
> `apache::thrift::async::TConcurrentClientSyncInfo::updatePending(std::string 
> const&, apache::thrift::protocol::TMessageType, int)'
> collect2: error: ld returned 1 exit status
> Step 4: change back dirs
> {code}
> any ideas?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to