# Connect problem

**URL:** <https://discuss.aerospike.com/t/connect-problem/3260>\
**Category:** General Discussion\
**Created:** [August 9, 2016, 6:56am UTC](https://discuss.aerospike.com/t/connect-problem/3260 "2016-08-09T06:56:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![\_PPC-help.ru](https://avatars.discourse-cdn.com/v4/letter/_/f04885/32.png) [@\_PPC-help.ru](https://discuss.aerospike.com/u/_PPC-help.ru)\
**Post date:** [August 9, 2016, 6:56am UTC](https://discuss.aerospike.com/t/connect-problem/3260/1 "2016-08-09T06:56:46Z")

</div>

Hi! I’m trying to connect to Aerospike with C Client LIbrary. I found connect functions in examples, but when i tried to compile code (gcc) i got error:

```auto
test.c:(.text+0x1e88): undefined reference to `as_config_init'
test.c:(.text+0x1eba): undefined reference to `aerospike_init'

```

Code:

```auto
    #include stdio.h>
    #include stdlib.h>
    #include string.h>
    #include unistd.h>
    #include aerospike/aerospike.h>
    #include aerospike/aerospike_key.h>
    #include aerospike/as_error.h>
    #include aerospike/as_record.h>
    #include aerospike/as_status.h>
    #include aerospike/aerospike.h>
    #include aerospike/aerospike_index.h>
    #include aerospike/aerospike_key.h>
    #include aerospike/aerospike_udf.h>
    #include aerospike/as_bin.h>
    #include aerospike/as_bytes.h>
    #include aerospike/as_error.h>
    #include aerospike/as_config.h>
    #include aerospike/as_key.h>
    #include aerospike/as_operations.h>
    #include aerospike/as_password.h>
    #include aerospike/as_record.h>
    #include aerospike/as_record_iterator.h>
    #include aerospike/as_status.h>
    #include aerospike/as_string.h>
    #include aerospike/as_val.h>
    void main ()
    {
        aerospike* as;
        as_config cfg;
    	as_config_init(&cfg);
    	as_config_add_host(&cfg, "127.0.0.1", 3000);
    	aerospike_init(as, &cfg);
    	as_error err;
        printf("Our first program for Linux.\n");
    }

```

I have written my app in php and python, it works well but slow, so I decided to try to write it in C lang, but I haven’t any experience in it. Please, just help me to import libs and connect to database. Thanks 🙂

---

<div class="post-metadata">

**Author:** ![b.sangole](https://avatars.discourse-cdn.com/v4/letter/b/9fc348/32.png) [@b.sangole](https://discuss.aerospike.com/u/b.sangole)\
**Post date:** [May 17, 2017, 11:40am UTC](https://discuss.aerospike.com/t/connect-problem/3260/2 "2017-05-17T11:40:08Z")

</div>

Hi… I am also facing the same issue…Please help if you’d already figured it out…

Thanks in advance!!

---

<div class="post-metadata">

**Author:** ![pgupta](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/pgupta/32/2351_2.png) [@pgupta](https://discuss.aerospike.com/u/pgupta)\
**Post date:** [May 18, 2017, 6:10am UTC](https://discuss.aerospike.com/t/connect-problem/3260/3 "2017-05-18T06:10:53Z")

</div>

Here are my scratch notes from getting a C Client example working, see if it helps!

```
$ 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](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.

---

<div class="post-metadata">

**Author:** ![b.sangole](https://avatars.discourse-cdn.com/v4/letter/b/9fc348/32.png) [@b.sangole](https://discuss.aerospike.com/u/b.sangole)\
**Post date:** [May 18, 2017, 7:27am UTC](https://discuss.aerospike.com/t/connect-problem/3260/4 "2017-05-18T07:27:27Z")

</div>

Thank you !.. I will try this one and will let you know if it would work !
