Mesfin, Yebio | 1 Nov 14:39 2004
Picon

Swig error

SWIG people I need your help

I have created my dll using swig wrapper but when I try to load it.
The error message is: Type error. Expected a pointer

In the wrapper source code.
 if (flags & SWIG_POINTER_EXCEPTION) 
 Tcl_SetResult(interp, (char *) "Type error. Expected a pointer",
TCL_STATIC);
     return TCL_ERROR;
  } 

Can any off tell me how to fix  this problem please.
Thanks!
Yebio

Mesfin, Yebio | 1 Nov 15:25 2004
Picon

RE: Swig error

My example.i the following text.
bcmos.h in this example.i have a lot off typedefs.
Can you tell me how to incllude this bcmos.h in this exmaple.i
The way it is now is prodducing  "Type error. Expected a pointer"
Any saggestion please!

Example.i
############################################
%module example

%{ #define BCMDECL __stdcall
#include "bicomapi.h"
%}

%{ #define BCMDECL __stdcall
#include "bcmsrl.h"
%}

%include "bcmos.h"
%include "bcm32kmd.h"
%include "bicomapi.h"
%include "bcm32dll.h"
%include "srlinfo.h"
%include "srlevent.h"
%include "bcmsrl.h"

extern int    gcd(int x, int y);
extern double Foo;
extern char pcDigits[25];	

(Continue reading)

Mesfin, Yebio | 1 Nov 15:26 2004
Picon

RE: Swig error

My example.i the following text.
bcmos.h in this example.i have a lot off typedefs.
Can you tell me how to incllude this bcmos.h in this exmaple.i The way
it is now is prodducing  "Type error. Expected a pointer"
Any saggestion please!

Example.i
############################################
%module example

%{ #define BCMDECL __stdcall
#include "bicomapi.h"
%}

%{ #define BCMDECL __stdcall
#include "bcmsrl.h"
%}

%include "bcmos.h"
%include "bcm32kmd.h"
%include "bicomapi.h"
%include "bcm32dll.h"
%include "srlinfo.h"
%include "srlevent.h"
%include "bcmsrl.h"

extern int    gcd(int x, int y);
extern double Foo;
extern char pcDigits[25];	

(Continue reading)

William.Fulton | 1 Nov 17:46 2004

%feature regression

I've just found that %newobject is misbehaving for const methods. Also happens with %exception, so looks
like a %feature problem. Marcelo, any thoughts as you improved %feature recently?

%newobject One::getSquare() const; // Does not get used

%inline %{
struct One {
  Square *getSquare() const { return new Square(10); }
};
%}

-----

%newobject One::getSquare(); // Incorrectly gets used

%inline %{
struct One {
  Square *getSquare() const { return new Square(10); }
};
%}

William

Visit our website at http://www.ubs.com

This message contains confidential information and is intended only 
for the individual named.  If you are not the named addressee you 
should not disseminate, distribute or copy this e-mail.  Please 
notify the sender immediately by e-mail if you have received this 
e-mail by mistake and delete this e-mail from your system.
(Continue reading)

William.Fulton | 1 Nov 18:13 2004

Another %feature regression

The generic %exception overrides a more specific one when templates are involved.

%exception {
// default %exception
}

%exception std::vector::get {
// get %exception
}

%inline %{

namespace std {

    template<class T> class vector {
      public:
        void push_back(const T& x) {}
#ifdef SWIG
        %extend {
            T& get(int i) {
                ...
                throw std::out_of_range("vector index out of range");
            }
        }
#endif
    };
}

%}

(Continue reading)

Marcelo Matus | 1 Nov 19:17 2004
Picon

Re: %feature regression

It seems to be working now.

There was a problem with a hack of mine (first case) + a piece of code 
that was removing
the qualifiers (const) (second case).

So,  it seems it was also broken before :).

Now seems to be working, see features.i

William.Fulton <at> ubs.com wrote:

>I've just found that %newobject is misbehaving for const methods. Also happens with %exception, so looks
like a %feature problem. Marcelo, any thoughts as you improved %feature recently?
>
>%newobject One::getSquare() const; // Does not get used
>
>%inline %{
>struct One {
>  Square *getSquare() const { return new Square(10); }
>};
>%}
>
>-----
>
>%newobject One::getSquare(); // Incorrectly gets used
>
>%inline %{
>struct One {
>  Square *getSquare() const { return new Square(10); }
(Continue reading)

Marcelo Matus | 1 Nov 19:21 2004
Picon

Re: Another %feature regression

This

%exception std::vector::get {
// get %exception
}

by sure was not working, but this was working ok:

%exception std::vector<int>::get {
// get %exception
}

new code was added to manage the base template case.
Now both work fine. This also should fix more template + features
problems

see features.i

Marcelo

William.Fulton <at> ubs.com wrote:

>The generic %exception overrides a more specific one when templates are involved.
>
>%exception {
>// default %exception
>}
>
>%exception std::vector::get {
>// get %exception
(Continue reading)

William S Fulton | 1 Nov 22:44 2004
Picon

Re: Time for release candidate?

Marcelo Matus wrote:
> Python and Ruby are ready to go,
> 
> Just test Ruby with 1.8+ (see CHANGES.current).
> 
> Also, it seems you can close all the ruby bugs, since the 5-6
> specific ones are solved now.
> 
> 
> William S Fulton wrote:
> 
>> John Lenz wrote:
>>
>>> On 10/29/04 18:20:17, William S Fulton wrote:
>>>
>>>> I was thinking of making a release candidate this weekend. Is there  
>>>> anything that needs doing before put this out? Probably a 
>>>> commandline  option to get back the old runtime approach as 
>>>> discussed in the previous  email. Anything else?
>>>>
>>>> Directors in the Ruby module have a couple of problems, but other 
>>>> than  that the test-suite for C#, Java, Python, Tcl, Perl and Python 
>>>> seems to  be in good shape.
>>>
>>>
>>>
>>>
>>> I probably won't get a chance to look at stuff until Monday... I have 
>>> some  chicken changes to make, and of course the runtime stuff.  
>>> Perhaps we could  make a release candidate monday night?
(Continue reading)

William S Fulton | 1 Nov 22:54 2004
Picon

Python on Solaris

Forgot to mention these 2 test cases using Solaris Workshop 7 with Python 2.3.3 
look a bit sick ...

Checking testcase lib_std_map (with run test) under python
"lib_std_map_wrap.cxx", line 1712: Error: The name SWIG_Python_TypeError(const 
char*, _object*) is unusable in swig::PySequence_Ref<std::pair<int, 
A*>>::operator std::pair<int, A*>() const.
"lib_std_map_wrap.cxx", line 1947:     Where: While instantiating 
"swig::assign<swig::PySequence_Cont<std::pair<int, A*>>, int, A*>(const 
swig::PySequence_Cont<std::pair<int, A*>>&, std::multimap<int, A*, 
std::less<int>, std::allocator<std::pair<const int, A*>>>*)".
"lib_std_map_wrap.cxx", line 1947:     Where: Instantiated from non-template code.
"lib_std_map_wrap.cxx", line 1714: Error: The name SWIG_Python_AddErrMesg(const 
char*, int) is unusable in swig::PySequence_Ref<std::pair<int, A*>>::operator 
std::pair<int, A*>() const.
"lib_std_map_wrap.cxx", line 1947:     Where: While instantiating 
"swig::assign<swig::PySequence_Cont<std::pair<int, A*>>, int, A*>(const 
swig::PySequence_Cont<std::pair<int, A*>>&, std::multimap<int, A*, 
std::less<int>, std::allocator<std::pair<const int, A*>>>*)".
"lib_std_map_wrap.cxx", line 1947:     Where: Instantiated from non-template code.
2 Error(s) detected.
make[2]: *** [python_cpp] Error 2
make[1]: *** [lib_std_map.cpptest] Error 2
Checking testcase lib_std_wstring (with run test) under python
"lib_std_wstring_wrap.cxx", line 1336: Error: WCHAR_MIN is not defined.
"lib_std_wstring_wrap.cxx", line 1336: Error: WCHAR_MAX is not defined.
2 Error(s) detected.
make[2]: *** [python_cpp] Error 2
make[1]: *** [lib_std_wstring.cpptest] Error 2

(Continue reading)

Bob Tolbert | 1 Nov 23:09 2004

C#/Mono on darwin

I notice that unlike JAVA, CSHARP just uses the $(SO) variable for the bundle extension. 
And by default, configure sets this to ".bundle"

However, for mono (at least for 1.0.2 that I have installed) these bundles need to end in 
".so"

Now, I suppose this could be a mono on OS X bug, but to get the examples to build and run 
out of the box we need to create a new $(CSHARPSO) variable in configure.

Attached is a patch against the latest CVS that adds CSHARPSO to configure.in and into the 
Examples/Makefile.in

Bob Tolbert

Index: configure.in
===================================================================
RCS file: /cvsroot/swig/SWIG/configure.in,v
retrieving revision 1.126
diff -c -3 -p -r1.126 configure.in
*** configure.in	27 Oct 2004 20:40:41 -0000	1.126
--- configure.in	1 Nov 2004 22:02:45 -0000
*************** case $host in
*** 1386,1391 ****
--- 1386,1400 ----
   *)CSHARPLIBRARYPREFIX="lib";;
   esac

+ # C#/Mono on Mac OS X tweaks
+ case $host in
+ *-*-darwin*)
(Continue reading)


Gmane