Hello All,
I have installed shmap library in which we can write into map through shared memory. I got it from open source. I wrote a program based on it's APIs. While compiling I am getting some linking errors. The description is below ...
LD_LIBRARY_PATH=/usr/local/lib/
PROGRAM : Shmap.cpp
-----------------------------------------
#include <iostream>
#include <string.h>
#include "/usr/local/include/shmap.h"
using namespace std;
int main()
{
shmap_opts *p_opts;
shmap *sample_map;
sample_map = shmap_init ( p_opts );
string name = "deepak";
char const *conv_name = name.c_str();
string value = "3";
char const *conv_value = value.c_str();
int add_chck = shmap_add_value ( sample_map, conv_name , conv_value);
cout<<"AFTER ADDITION VALUE = "<<add_chck<<endl;
void *get_chck;
int cached = 1;
get_chck = shmap_get_value( sample_map, conv_name, cached );
cout<<"VALUE GOT = "<<get_chck<<endl;
return 0;
}
--------------------------------------------------
COMPILATION
g++ Shmap.cpp -o Shmap
/tmp/cc6v4tBa.o: In function `main':
Shmap.cpp

.text+0x8b): undefined reference to `shmap_init(shmap_opts*)'
Shmap.cpp

.text+0x16b): undefined reference to `shmap_add_value(shmap*, char const*, char const*)'
Shmap.cpp

.text+0x1c3): undefined reference to `shmap_get_value(shmap*, char const*, int)'
collect2: ld returned 1 exit status
Can anybody guide me on this ???