[C++-sig] Question about using IT++ in boost.python
Jim Bosch
talljimbo at gmail.com
Wed Sep 8 00:48:46 CEST 2010
On 09/07/2010 01:25 PM, Junwei Zhang wrote:
> Hi,
>
> I am now considering using boost.python to integrate some IT++(C++
> scientific library)
> codes to python.
> But when I do some simple example
> to wrapper this func
> int vfunc(int n)
> {
> vec a = linspace(0,n,10); // already include IT++ and using its namespace
> vec b= linspace(0,2*n,10);//
> std::cout<<a<<'\n'<<b<<'\n';
> return a*b;
>
>
>
> }
>
> def("vfunc", vfunc);
>
> It compiles but when import the module
> there is error
> raceback (most recent call last):
> File "<stdin>", line 1, in<module>
> ImportError: ./hello.so: undefined symbol: _ZN4itpp8linspaceEddi
>
> any suggestion is appreciate!!
>
>
It looks like you need to link your Python module (it's a shared
library) against the IT++ shared library.
Jim Bosch
More information about the Cplusplus-sig
mailing list