我試圖使一個Python的這個庫綁定:錯誤與痛飲:未定義的符號:_ZN7hosters11hostersLink7getLinkEi
http://code.google.com/p/hosterslib/。
我使用痛飲,繼承人是代碼:
%module pyhosters
%{
#include "hosters/hosters.hpp"
%}
%include "hosters/hosters.hpp"
我跑
痛飲-C++ -python -o swig_wrap.cxx swig.i
和我編譯
g ++ -O2 -fPIC -sha紅-o _pyhosters.so swig_wrap.cxx
python-config --libs --cflags
-lhosters -lcln -lhtmlcxxpkg-config libglog --libs --cflags
-I/usr/include目錄/ python2.6的-Wall -Wextra
但是當我運行Python和我導入它,我得到:
>>> import pyhosters
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "./pyhosters.py", line 7, in <module>
import _pyhosters
ImportError: ./_pyhosters.so: undefined symbol: _ZN7hosters11hostersLink7getLinkEi
我該如何解決這個問題?
謝謝。
使用標記(如果neccessary閱讀幫助),並檢查問題的外觀預覽,然後再發布。 – 2010-03-24 22:20:42