I don't know whether you received my answer, so I'm posting it here.
First I compiled imgdb core:
matej@hitchhiker:~/bp-playground/net.imgseek.imgdb/src/net/imgseek/
imgdb/core$ python build-python.py build
Then I tried to compile my test program:
matej@hitchhiker:~/bp-playground/net.imgseek.imgdb/src/net/imgseek/
imgdb/core$ g++ -DLinuxBuild test.cpp -c
In file included from /usr/include/c++/4.4/ext/hash_set:60,
from imgdb.h:65,
from test.cpp:2:
/usr/include/c++/4.4/backward/backward_warning.h:28: warning: #warning
This file includes at least one deprecated or antiquated header which
may be removed without further notice at a future date. Please use a
non-deprecated interface with equivalent functionality instead. For a
listing of replacement headers and interfaces, consult the file
backward_warning.h. To disable this warning use -Wno-deprecated.
Compiling succeeded (with 1 warning), there was only problem with my
first attempts when I forgot to add -DLinuxBuild.
My linking:
matej@hitchhiker:~/bp-playground/net.imgseek.imgdb/src/net/imgseek/
imgdb/core$ g++ test.o imgdb.so
imgdb.so: undefined reference to `PyTuple_SetItem'
imgdb.so: undefined reference to `PyExc_ValueError'
imgdb.so: undefined reference to `PyLong_AsLong'
imgdb.so: undefined reference to `_PyInstance_Lookup'
imgdb.so: undefined reference to `PyObject_GetAttr'
imgdb.so: undefined reference to `PyObject_Call'
...
imgdb.so: undefined reference to `PyLong_FromUnsignedLong'
imgdb.so: undefined reference to `PyArg_UnpackTuple'
imgdb.so: undefined reference to `PyExc_SystemError'
imgdb.so: undefined reference to `PyString_AsString'
imgdb.so: undefined reference to `PyInt_FromLong'
imgdb.so: undefined reference to `PyObject_Malloc'
imgdb.so: undefined reference to `PyBool_FromLong'
collect2: ld returned 1 exit status
I assume that problem is in some missing library (python?). I tried to
add the same linking parameters as in build-python.py but with the
same error result.
And my test program (test.cpp):
#include "bloom_filter.h"
#include "imgdb.h"
#include <iostream>
int main( int argc, char * argv[] )
{
const int db = 1;
initDbase( db );
std::cout << isValidDB( db );
closeDbase();
return 0;
}
Thank you, Matej Kupciha
On Nov 15, 4:00 pm, Ricardo Niederberger Cabral
<
ricardo.cab...@imgseek.net> wrote:
> You should be able to link imgdb code into your c++ program. What
> error msg do you get when compiling? How are you compiling/linking it?
>
> --
> Ricardo Niederberger Cabralhttp://
www.imgseek.net/