You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pulsar.apache.org by Apache Pulsar Slack <ap...@gmail.com> on 2019/01/30 09:11:02 UTC

Slack digest for #dev - 2019-01-30

2019-01-29 23:06:28 UTC - Patrick Johnmeyer: @Patrick Johnmeyer has joined the channel
----
2019-01-29 23:14:59 UTC - Patrick Johnmeyer: Hello, I've been trying to utilize the pulsar-cpp-client and I am having problems. I downloaded both DEB files from <https://pulsar.apache.org/docs/en/client-libraries-cpp/> and installed them with `apt install`. I then wrote a very simple C main that attempts to call `pulsar_client_configuration_create`. It finds the `pulsar/c/client.h` header and compiles fine, but no matter how I invoke `gcc` it fails to link.

The first time I get this error: `error adding symbols: Archive has no index; run ranlib to add one`

I then ran `ranlib`, and now I get the error: `undefined reference to 'pulsar_client_configuration_create'`
----
2019-01-29 23:15:44 UTC - Matteo Merli: Hi, how are you linking your executable?
----
2019-01-29 23:16:41 UTC - Matteo Merli: are you passing `-lpulsar` ?
----
2019-01-29 23:16:49 UTC - Matteo Merli: or trying to link statically ?
----
2019-01-29 23:18:18 UTC - Patrick Johnmeyer: Just `gcc -o foo foo.c /usr/lib/libpulsar.a`
----
2019-01-29 23:18:49 UTC - Matteo Merli: Ok, there are some issues with link statically. You should try with `-lpulsar` instead
----
2019-01-29 23:20:01 UTC - Patrick Johnmeyer: Can you go into more detail? Unfortunately linking statically is actually a requirement for what I am working on
----
2019-01-29 23:29:35 UTC - Matteo Merli: There are 2 issues to fix there:
 1. ranlib is for some reason failing to generate the archive index for libpulsar.a  (That might be due to the linking visibility flags used to “shade” dependency symbols inside `libpulsar.so`. Though that’s just an hypotesis at this point)
 2. `libpulsar.a` doesn’t contain all the dependencies (unlike `libpulsar.so`)
----
2019-01-29 23:34:49 UTC - Patrick Johnmeyer: Yeah, I rebuilt the debs without the `strip` line in `build-deb.sh` and that seemed to bypass the ranlib problem

But then I get a **TON** of undefined references. Might be a clue to somebody though? I'll put that build log on the issue
----
2019-01-29 23:35:48 UTC - Matteo Merli: yes, all the dependencies .a files will have to be added
----
2019-01-29 23:37:32 UTC - Matteo Merli: let me get the list
----
2019-01-29 23:41:09 UTC - Matteo Merli: ```
/usr/local/lib/libboost_program_options-mt.a
/usr/local/lib/libboost_filesystem-mt.a
/usr/local/lib/libboost_regex-mt.a
/usr/local/lib/libboost_thread-mt.a
/usr/local/lib/libboost_system-mt.a
/usr/local/lib/libboost_chrono-mt.a
/usr/local/lib/libboost_date_time-mt.a
/usr/local/lib/libboost_atomic-mt.a
/usr/lib/libcurl.a
/usr/local/opt/openssl/lib/libssl.a
/usr/local/opt/openssl/lib/libcrypto.a
/usr/lib/libz.a
/usr/local/lib/libprotobuf.a
/usr/local/lib/libjsoncpp.a
```
----
2019-01-29 23:51:33 UTC - Patrick Johnmeyer: Thanks for the help. Maybe I'll be able to work on that issue for the project.
----
2019-01-29 23:52:16 UTC - Matteo Merli: :+1: Ideally all of these should be coming packaged into `libpulsar.a`
----
2019-01-30 08:44:34 UTC - xiaolong.ran: @xiaolong.ran has joined the channel
----
2019-01-30 08:45:58 UTC - xiaolong.ran: hello @Matteo Merli i am catching up the function for go client, want to know the progress of this [pull request#2475](<https://github.com/apache/pulsar/pull/2475>).
----
2019-01-30 09:00:17 UTC - xiaolong.ran: Is there any tasks that needs to be catch up for the go client?
----
2019-01-30 09:04:26 UTC - Sijie Guo: @xiaolong.ran I think you can check `Multi-hosts service url support`. but it is not available in C++ client yet. so you might have to add the feature in c++ client first and then go :slightly_smiling_face:
----
2019-01-30 09:06:25 UTC - xiaolong.ran: :+1:
----