Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

freeling error with python and java api: undefined symbol: _ZN5boost6system15system_categoryEv

I installed freeling in Ubuntu 13.10 and I'm trying to use either the python or java apis but I get an error whenever I try to:

    matias@matias-IdeaPad-U430-Touch:~/Programas/Tools/freeling/freeling-3.1/APIs/python$ ./sample.py <test.txt >out.txt
Traceback (most recent call last):
  File "./sample.py", line 10, in <module>
    import freeling
  File "/home/matias/Programas/Tools/freeling/freeling-3.1/APIs/python/freeling.py", line 26, in <module>
    _freeling = swig_import_helper()
  File "/home/matias/Programas/Tools/freeling/freeling-3.1/APIs/python/freeling.py", line 22, in swig_import_helper
    _mod = imp.load_module('_freeling', fp, pathname, description)
  File "/usr/lib/python3.3/imp.py", line 188, in load_module
    return load_dynamic(name, filename, file)
ImportError: /usr/local/lib/libfreeling-3.1.so: undefined symbol: _ZN5boost6system15system_categoryEv

And for Java:

matias@matias-IdeaPad-U430-Touch:~/Programas/Tools/freeling/freeling-3.1/APIs/python$ ./sample.py <test.txt >out.txt
Traceback (most recent call last):
  File "./sample.py", line 10, in <module>
    import freeling
  File "/home/matias/Programas/Tools/freeling/freeling-3.1/APIs/python/freeling.py", line 26, in <module>
    _freeling = swig_import_helper()
  File "/home/matias/Programas/Tools/freeling/freeling-3.1/APIs/python/freeling.py", line 22, in swig_import_helper
    _mod = imp.load_module('_freeling', fp, pathname, description)
  File "/usr/lib/python3.3/imp.py", line 188, in load_module
    return load_dynamic(name, filename, file)
ImportError: /usr/local/lib/libfreeling-3.1.so: undefined symbol: _ZN5boost6system15system_categoryEv

Curiously enough the java file does compile without errors.

When I installed Freeling I did get the following error:

 /bin/bash ../../libtool --tag=CXX   --mode=link g++ -O3 -Wall   -L../../src/libfreeling  -o dicc2phon corrector/dicc2phon-dicc2phon.o -lfreeling -lboost_regex    -lz 
libtool: link: g++ -O3 -Wall -o .libs/dicc2phon corrector/dicc2phon-dicc2phon.o  -L../../src/libfreeling /home/matias/Programas/Tools/freeling/freeling-3.1/src/libfreeling/.libs/libfreeling.so -lboost_regex -lz
corrector/dicc2phon-dicc2phon.o: In function `_GLOBAL__sub_I_main':
dicc2phon.cc:(.text.startup+0x23): undefined reference to `boost::system::generic_category()'
dicc2phon.cc:(.text.startup+0x2f): undefined reference to `boost::system::generic_category()'
dicc2phon.cc:(.text.startup+0x3b): undefined reference to `boost::system::system_category()'
collect2: error: ld returned 1 exit status

But the analyze command works perfectly fine when I call it.

I'm using libboost1.53, I tried to install another version but kept getting errors of unresolved dependencies and broken packages so I haven't been able to try with any other version.

like image 839
Matías Guzmán Naranjo Avatar asked Nov 18 '13 20:11

Matías Guzmán Naranjo


1 Answers

You are missing linking against: libboost_system.a (or libboost_system.so), so the Makefile rule (for linking) should have the following at the end: -lboost_system (this should already be in the search path for g++.

like image 189
kingtorus Avatar answered Nov 13 '22 03:11

kingtorus