c - 使用 aerospike 客户端库编译 C 程序时体系结构 x86_64 的 undefined symbol

标签 c linker-errors aerospike

我是 aerospike 的新手,刚刚习惯它。现在我已经安装了 C 客户端库,正如他们在文档中所描述的那样。

这是我的代码 Test.c

这是我编译它时遇到的错误。 Error

我在这里假设链接器无法将 aerospike 客户端的功能连接到我的代码。我不明白如何解决它!

最佳答案

以下是我在 Ubuntu VM 中使用 C 客户端的笔记,Aerospike 服务器也安装在该 VM 中并正在运行。

Using eclipse to develp C code:
sudo apt-get install eclipse eclipse-cdt g++
Note: C Client does not support AsuRM processors.
I am working inside a Ubuntu 16.04 VM.

$lsb_release -a   ⇒ shows my ubuntu version 

pgupta@ubuntu:/var/log/aerospike$ lsb_release -a
No LSB modules are available.
Distributor ID:    Ubuntu
Description:    Ubuntu 16.04.1 LTS
Release:    16.04
Codename:    xenial

Required library:

$cd ~
$sudo apt-get install libssl-dev

Download C Client and install for Ubuntu 16.x:  http://www.aerospike.com/docs/client/c/install

It was downloaded in my ~/Downloads directory.
$cd Downloads/
$ls
$tar xvf aerospike-client-c-4.1.1.ubuntu16.04.x86_64.tgz
$cd aerospike-client-c-4.1.1.ubuntu16.04.x86_64/
$ sudo dpkg -i aerospike-client-c-devel-4.1.1.ubuntu16.04.x86_64.deb
$ cd examples
$ make
$cd basic_examples/
$cd put
$cd target/
$ sudo service aerospike start   (I have a server running in my ubuntu 16 VM)
$./example

Output shows I was able to read and write records to the server.

关于c - 使用 aerospike 客户端库编译 C 程序时体系结构 x86_64 的 undefined symbol ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47081200/

相关文章:

c - 我是否可以通过将变量设为静态来提高性能?

c++ - CMake 和点云库的链接器错误

c++ - 示例程序的 docopt 链接器错误

node.js - Aerospike 是否支持像 MongoDB 中那样基于位置的查询?

java - 在 Java/Scala 中,如何以最少量的代码/以最优雅的方式以秒为单位获取特定的 UTC 日期?

我可以从具有许多编译器标志的 c 程序中导出使用过的代码吗?

ios - 'tm' 的定义必须在需要之前从模块 'Darwin.C.time' 导入

c - 包含路径的预处理器串联

c++ - 如何定义一个模板类并将其分成多个文件?

aerospike - 无法在centos 6.3上启动aerospike,没有可用的版本信息(bin/asd需要)