mingw

View: New views
3 Messages — Rating Filter:   Alert me  

mingw

by Robert Johansson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

Hi all, I’m trying out SWIG under Windows using Python25, mingw3.4.5 and swigwin-1.3.40. I followed the steps outlined here:

 

http://boodebr.org/main/python/build-windows-extensions

 

on the factorial function-example here:

 

http://swig.svn.sourceforge.net/viewvc/swig/trunk/Doc/Manual/Python.html#Python_nn6

 

at first it seemed to work out just fine, I got a .pyd file and I can import example.py and run example.fact(n) for small values of n. However when I try n=20 I get an integer less than 0. I also tried to compile everything directly with gcc (not using distutils), but with exactly the same result. I would be very grateful for suggestions or pointers to more information to help me out on this. Is it my version of mingw that is to old?

 

Robert

 

 

 


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Swig-user mailing list
Swig-user@...
https://lists.sourceforge.net/lists/listinfo/swig-user

Re: mingw

by Josh Cherry :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



On Tue, 27 Oct 2009, Robert Johansson wrote:

> on the factorial function-example here:
>
>
>
> http://swig.svn.sourceforge.net/viewvc/swig/trunk/Doc/Manual/Python.html#Pyt
> hon_nn6
>
>
>
> at first it seemed to work out just fine, I got a .pyd file and I can import
> example.py and run example.fact(n) for small values of n. However when I try
> n=20 I get an integer less than 0. I also tried to compile everything
> directly with gcc (not using distutils), but with exactly the same result. I
> would be very grateful for suggestions or pointers to more information to
> help me out on this. Is it my version of mingw that is to old?

It's probably just overflow in the integer arithmetic (32 bits?), in which
case it has nothing to do with wrapping or SWIG; you'd get the same result
calling it from C.

Josh


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Swig-user mailing list
Swig-user@...
https://lists.sourceforge.net/lists/listinfo/swig-user

Re: mingw

by Robert Johansson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, 27 Oct 2009, Robert Johansson wrote:

> on the factorial function-example here:
>
>
>
>
http://swig.svn.sourceforge.net/viewvc/swig/trunk/Doc/Manual/Python.html#Pyt
> hon_nn6
>
>
>
> at first it seemed to work out just fine, I got a .pyd file and I can
import
> example.py and run example.fact(n) for small values of n. However when I
try
> n=20 I get an integer less than 0. I also tried to compile everything
> directly with gcc (not using distutils), but with exactly the same result.
I
> would be very grateful for suggestions or pointers to more information to
> help me out on this. Is it my version of mingw that is to old?

It's probably just overflow in the integer arithmetic (32 bits?), in which
case it has nothing to do with wrapping or SWIG; you'd get the same result
calling it from C.

Josh

Aha, of course. It was quite a while since I wrote anything I C. I have to
do some reading in the weekend. Thanks a lot!

Cheers, Robert



------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Swig-user mailing list
Swig-user@...
https://lists.sourceforge.net/lists/listinfo/swig-user