2013-10-31 35 views
1

我剛寫的代碼用Cython只是簡單如說用Cython C++未定義的引用到std ::的ios_base ::失敗

# distutils: language = c++ 

from libcpp.map cimport map,pair 
from ios import * 



cdef map[int,int] * u = new map[int,int]() 

cdef add_item(int n, int x): 
    cdef pair[int,int]p = pair[int,int](n,x) 
    u.insert(p) 

def add(int n, int x): 
    add_item(n,x) 

添加構建文件一樣

def make_ext(modname, pyxfilename): 
    from distutils.extension import Extension 
    return Extension(name=modname, 
        sources=[pyxfilename], 
        language='C++') 

和運行像

簡單的腳本
import hello 

with lines

進口pyximport pyximport.install()

我sitecustomize.py

在腳本執行我得到

ImportError: Building module hello failed: ['ImportError: /home/odomontois/.pyxbld/lib.linux-x86_64-2.7/hello.so: undefined symbol: _ZTINSt8ios_base7failureE\n']

c++filt _ZTINSt8ios_base7failureE打印typeinfo for std::ios_base::failure

是否有可能找出目標文件我應該包括以及如何在我的pyxbld文件中做到這一點。

+0

得到了確切的相同的錯誤消息解決了,但你的答案現在所做的工作對我來說。 – wdg

回答

相關問題