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:
test.c:(.text+0x1e88): undefined reference to `as_config_init'
test.c:(.text+0x1eba): undefined reference to `aerospike_init'
Code:
#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