Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined symbol exception using bsonsearch.bsoncompare #1

Closed
quimm2003 opened this issue Nov 30, 2016 · 1 comment
Closed

Undefined symbol exception using bsonsearch.bsoncompare #1

quimm2003 opened this issue Nov 30, 2016 · 1 comment

Comments

@quimm2003
Copy link

quimm2003 commented Nov 30, 2016

Hi there,

I'm using debian jessie, I've installed dependencies, cloned the code and compiled the source code using this command:

$ gcc -Wall -I/usr/local/include/libbson-1.0 -L/usr/local/lib -lbson-1.0 -DWITH_PROJECTION -DWITH_UTILS -DWITH_CONDITIONAL -DWITH_TEXT -DWITH_STEMMER -DWITH_ASPELL -DWITH_YARA -lpcre -shared -o libbsoncompare.so -fPIC bsoncompare.c mongoc-matcher.c mongoc-matcher-op.c mongoc-matcher-op-geojson.c mongoc-bson-descendants.c

Installed libbsoncompare.so:

cp libbsoncompare.so /usr/lib
ldconfig -n /usr/lib

And when I try to use it in python code:

from bsonstream import KeyValueBSONInput
import bsonsearch
with bsonsearch.bsoncompare() as bc:

I always get an exception which is thrown at bsonsearch/_init_.py, line 40:

OSError: /usr/lib/libbsoncompare.so: undefined symbol: _mongoc_matcher_op_yara_new

Am I missing something?

Thanks

@bauman
Copy link
Owner

bauman commented Apr 7, 2017

if you are going to include yara support (-DWITH_YARA), you need to link against yara at compile time by adding -lyara in the gcc line

the RedHat spec file has two versions baked in, one with everything and a "lite" version with only the basics.

https://github.com/bauman/bsonsearch/blob/master/lib/bsoncompare.spec#L95-L96

Start by copying the lite version and include other functions as you see fit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants