c++ - 在ubuntu上安装node js pulsar客户端

标签 c++ node.js ubuntu-16.04 apache-pulsar

我正在尝试在 ubuntu 上安装 Node js 客户端的 pulsar-client。我收到以下错误:

fatal error: pulsar/c/message.h: No such file or directory  #include <pulsar/c/message.h>
compilation terminated.
Pulsar.target.mk:116: recipe for target 'Release/obj.target/Pulsar/src/addon.o' failed
make: *** [Release/obj.target/Pulsar/src/addon.o] Error 1

文档说

Pulsar Node.js client library is based on the C++ client library. Follow the instructions for C++ library for installing the binaries through RPM, Deb or Homebrew packages.

(Note: you will need to install not only the pulsar-client library but also the pulsar-client-dev library)

但是,在 Ubuntu 上安装 C++ 库的说明不是很清楚。目前还不清楚如何安装 pulsar-client-dev 库。

最佳答案

你是对的,必须安装 C++ 库。需要注意的是,请确保安装了兼容的 C++ 库。 https://github.com/apache/pulsar-client-node#compatibility

要在 ubuntu 上安装 C++ 库,这里是一个来 self 们基于 Ubuntu 构建的 Docker 镜像的示例。 https://github.com/kafkaesque-io/pulsar-beam/blob/master/Dockerfile#L29

wget --user-agent=Mozilla -O apache-pulsar-client.deb "https://archive.apache.org/dist/pulsar/pulsar-2.4.1/DEB/apache-pulsar-client.deb"
wget --user-agent=Mozilla -O apache-pulsar-client-dev.deb "https://archive.apache.org/dist/pulsar/pulsar-2.4.1/DEB/apache-pulsar-client-dev.deb"

apt install -y ./apache-pulsar-client.deb
apt install -y ./apache-pulsar-client-dev.deb

关于c++ - 在ubuntu上安装node js pulsar客户端,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59894670/

相关文章:

C++ 链表——如何在不重复相同节点的情况下读取

c++ - libpq 中的查询流水线在哪里?

c++ - 我可以获取标准库中定义的函数的地址吗?

javascript - fsExtra.pathExists 和 fsExtra.exists 之间有什么区别?

python - 如何在不更改 keras.json 的情况下在 keras 中使用 TensorFlow 后端?

c++ - ThreadSanitizer 说我的 Atomic Inc/Dec 存在数据争用,这是误报吗?

node.js - 是否可以永久设置环境变量?

linux - 如何在atom代码编辑器中恢复已删除的文件

c - pthread 设置线程名称未显示在 htop 中

javascript - 将 csv-parse 输出保存到变量