Re: isk-daemon c++ compatibility

10 views
Skip to first unread message

Ricardo Niederberger Cabral

unread,
Nov 15, 2010, 10:00:41 AM11/15/10
to Matej Kupčiha, imgse...@googlegroups.com
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 Cabral
ricardo.cabral at imgseek.net
skype: rnc000

On 15/11/2010, at 11:44, Matej Kupčiha wrote:

Hi,

I would like to ask You one question about isk-daemon core library imgdb.so. Is it possible to use this shared library directly in my c++ program without using XML-RPC or SOAP to access its features? I successfully compiled the library (imgdb.so) but was unable to compile simple c++ test program, which was only including imgdb header file (#include "imgdb.h"). Or is it necessary to use some special compilation parameters to use this library with c++ code? (I'm using Ubuntu 10.10 and g++ compiler)

I'm using imgSeek to find similar images in project for computer forensic analysis (desktop software developed by university) and it would be better if this core library could be used directly.

Thank You for any response

Matej Kupciha

Ricardo Niederberger Cabral

unread,
Nov 15, 2010, 11:46:56 AM11/15/10
to Matej Kupčiha, imgse...@googlegroups.com

Matej Kupciha

unread,
Nov 15, 2010, 12:14:52 PM11/15/10
to imgseek_dev
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/
Reply all
Reply to author
Forward
0 new messages