Re: SWIG, c++ to Python: array of pointers (double pointer) not working

2009-03-17 Thread bobicanprogram
calculates the sum of an array of > pointers to ints. > > #include "dptest.h" > //the header file is just > //int sum(int**, int); > > int sum(int** dp, int len){ > int sum = 0; > for (int i = 0; i < len; i++){ > sum += *(

SWIG, c++ to Python: array of pointers (double pointer) not working

2009-03-14 Thread Matteo
s just //int sum(int**, int); int sum(int** dp, int len){ int sum = 0; for (int i = 0; i < len; i++){ sum += *(dp[i]); } return sum; } swig -c++ -python, then setup.py build_ext --inplace gets it nicely compiled and wrapped for python use. It a

SWIG: C++ and Python/ vector

2008-11-14 Thread Thomas
Hi, I have a C++-Class "compiled" with SWIG into a Python-Modul. It works fine. But there's is a problem with the C++-Returntype vector. If I call in my compiled Python-Module a certain method (from the C++- Class) there is no vector as result - although the C++-Counterpart returns a vector. The P

Re: help on python SWIG C++ extension

2008-09-17 Thread RLC
Thanks a lot, Tim and Diez, Merci Beaucoup!! I strongly suspect the error was caused by the memory operation. I made some modifications only on PolygonMesh definition. And now I have no annoying warnings. PolygonMesh *new_PolygonMesh() { PolygonMesh *p = new PolygonMesh; // p = (PolygonMesh *)

Re: help on python SWIG C++ extension

2008-09-16 Thread Tim Roberts
RLC <[EMAIL PROTECTED]> wrote: > >I am new to python SWIG. Recently I wrote a small program trying to >import collada files(using colladadom) into python so I could use >python cgkit to render them. However, during the progressing, I got >some problems. Every time I quit from Python, I get a segmen

Re: help on python SWIG C++ extension

2008-09-16 Thread Diez B. Roggisch
RLC schrieb: Hello I am new to python SWIG. Recently I wrote a small program trying to import collada files(using colladadom) into python so I could use python cgkit to render them. However, during the progressing, I got some problems. Every time I quit from Python, I get a segmentation fault, a

Re: SWIG C++ std::cout do not output to interactive interpreter IDLE

2008-04-22 Thread Juergen Perlinger
[EMAIL PROTECTED] wrote: > Dear All, > > I have some functions written in C++, which I try to approach from > python using swig. In the C++ functions I use std::cout to print stuff > to output. Everything works fine, but the only problem that I have is > that when I start IDLE and use the functio

SWIG C++ std::cout do not output to interactive interpreter IDLE

2008-04-22 Thread [EMAIL PROTECTED]
Dear All, I have some functions written in C++, which I try to approach from python using swig. In the C++ functions I use std::cout to print stuff to output. Everything works fine, but the only problem that I have is that when I start IDLE and use the functions what std::cout should print to the

Re: SWIG/C++

2008-04-10 Thread Matthieu Brucher
Hi, The error is generated because you are asking for a u8*, but the buffer is not a u8*, perhaps a char* or even a void*. If you change the method signature to either char* or void*, it may work like you want it to ;) Matthieu 2008/4/10, Bill Davy <[EMAIL PROTECTED]>: > > Is there a better plac

SWIG/C++

2008-04-10 Thread Bill Davy
Is there a better place to post such questions? Anyway, in the hope it is something simple, I would appreciate some help. I am adding some C++ code to Python. From Python I want to be able to read data from a target device, over USB. My software does all the hard work and I have a class: cla

SWIG & C Extensions, win32 & MinGW: undefined reference

2007-12-17 Thread newbie73
'1.0', ext_modules=[ Extension('example', ['example.c', 'example.i']) ]) //*** -- View this message in context: http://www.nabble.com/SWIG---C-Extensions%2C-win32---MinGW%3A-u

[Python-SWIG-C++] one question about wrapper interface files

2007-10-11 Thread [EMAIL PROTECTED]
Dear All, I am new to Python and SWIG, and I tried to search the SWIG mailinglist for my specific question, but I did not find it. And for a simple one c++ file, I can handle it successfully. Now I have a small project including several C files, file1.C file2.C file3.C file2.h file3.h , file1.C i

Re: newbie swig c++ to python

2007-10-07 Thread whatazor
Now it works, the problem was in the project configuration of the example, that put the directory in Addictional Dependencies while it must be in Addictional Library Directories bye w n 7 Ott, 18:35, whatazor <[EMAIL PROTECTED]> wrote: > Hi all, > I must wrap some c++ code in python with swig. I

newbie swig c++ to python

2007-10-07 Thread whatazor
Hi all, I must wrap some c++ code in python with swig. I try the swig examples for VC++ , but when I build the project it gives me that error: example fatal error LNK1181: cannot open input file 'C:\Programmi \Python25\libs.obj' Any idea? thank you w -- http://mail.python.org/mailman/listinfo/

SWIG, C++ and extension modules problem

2006-11-01 Thread anujseth76
Hi, This might be slightly off topic and but i am hoping someone here can help. I am trying to build a python wrapper for some C++ classes that access oracle. when i try loading the module i get the following errors Python 2.4.2 (#1, Nov 9 2005, 09:37:25) [C] on hp-ux11 Type "help", "copyright",

Re: SWIG, C++, and Mac OS X

2006-07-05 Thread nate
why are you modifying your setup.py file? can't you just run: swig -c++ -python exampleFile.i ? have you seen http://www.swig.org/tutorial.html , does it describe something like what you'd like to do? n -- http://mail.python.org/mailman/listinfo/python-list

SWIG, C++, and Mac OS X

2006-07-05 Thread Siddartha Krishnan
Hi, I'm new to using python and SWIG. I am running Mac OS X 10.4. I have a C++ class which I want to access from python, however I am unable to compile it as a shared module in Mac OS X. I have tried using Distutils and have successfully created a C extension module, however I am unable to

Nice documentation Python / SWIG / C++

2005-04-25 Thread Alexander Eisenhuth
Hi alltogether, I found a nice and useful article for extenting python with C++ using SWIG. It describe from the scratch especially for Windows. Maybe this can be included somewhere on www.python.org. Here is the link: http://www.geocities.com/foetsch/python/extending_python.htm Alexander