Eida_AlAmeri | 1 Apr 2008 08:42
Picon

install SWING

Hi all,

 

I have problem in installing SWING in Windows Operating System.

I download the SWING files and set variables environment but when I double click in swing.exe a black window appear then disappear immediately. what is the problem?

 

Thanks in advance

Eida

200301988

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Swig-user mailing list
Swig-user <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/swig-user
Rich E | 1 Apr 2008 23:32
Picon
Gravatar

new to SWIG, trying to bind a library

hello,

I tried using SWIG for the first time today.  I have a c-library that
would be nice to use in python, which is quite portable... so I was
hoping it would be easy to use SWIG for this.

Here is sms.i :

%module sms
%{
#include "../src/sms.h"
%}

%include "../src/sms.h"

I run:
swig -python sms.i

and it silently creates sms.py and sms_wrap.c, seems to work. I then
try to compile with:

 gcc -c sms_wrap.c -Wfatal-errors -DHAVE_CONFIG_H -I
/usr/include/python2.5/ -I /usr/lib/python2.5/config/ -I../src

and gcc errors because it cannot find the declarations that are in sms.h

Can anyone see where I am going wrong?  Sorry if this is blatantly
included in the documentation, I looked, tried, and this is where I
am.

cheers,
rich

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
Christopher Barker | 2 Apr 2008 00:54
Picon
Favicon

Re: new to SWIG, trying to bind a library

Rich E wrote:
> hello,I then
> try to compile with:
> 
>  gcc -c sms_wrap.c -Wfatal-errors -DHAVE_CONFIG_H -I
> /usr/include/python2.5/ -I /usr/lib/python2.5/config/ -I../src

This may not be the source of your issues, but you'll be happier in the 
long run if you use distutils to build your extension. See the recent 
docs, in the python section:

http://www.swig.org/Doc1.3/Python.html#Python_nn6

-Chris

--

-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker <at> noaa.gov

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
Phil Dibowitz | 2 Apr 2008 01:48

argout typemaps

Hey folks,

I'm trying to get an argout typemap working for a perl binding for a C
library. Currently I have:

  %typemap(argout) uint32_t* {
          if (argvi >= items) {
            EXTEND(sp,1);
          }
          printf("Saving size %d\n",*$1);
          /*
          $result = sv_newmortal();
          sv_setuv($result, (UV) (*$1));
          */
          $result = newSVuv((UV)(*$1));
          printf("The SV has the value %d\n", SvUV($result));
          argvi++;
  }

As you can see I tried both as a moralized and immortalized SV. The in
typemap for this is also important for this so here it is:

  %typemap(in) uint32_t* (uint32_t num) {
          $1 = &num;
  }

$result definitely has the right value before the wrapper returns, but
within perl, that SV is uninitialized. I get this output from the above
printf()s:

  Saving size 670607
  The SV has the value 670607

But then in perl when I print that argument after the function call, I get:

  Use of uninitialized value in concatenation (.) or string at ./test.pl
  line 22.
  Size is

The perl code is pretty simple:

   my ($blob, $size);

   my $err = concord::read_config_from_remote($blob, $size, \&cb, 1);
   print "Size is $size\n";

I tried doing an SvREFCNT_inc(ST(argvi)) in the resulting code, but that
didn't help either.

Any help would be greatly appreciated.

-- 
Phil Dibowitz                             phil <at> ipom.com
Open Source software and tech docs        Insanity Palace of Metallica
http://www.phildev.net/                   http://www.ipom.com/

"Never write it in C if you can do it in 'awk';
 Never do it in 'awk' if 'sed' can handle it;
 Never use 'sed' when 'tr' can do the job;
 Never invoke 'tr' when 'cat' is sufficient;
 Avoid using 'cat' whenever possible" -- Taylor's Laws of Programming

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Swig-user mailing list
Swig-user <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/swig-user
Christopher Barker | 2 Apr 2008 02:56
Picon
Favicon

Re: new to SWIG, trying to bind a library

Rich E wrote:
> does not
> explain how to compile it..

Look around for the distutils docs -- you can add locations for include 
files, libraries, etc, to your distutils setup.py script.

-Chris

--

-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker <at> noaa.gov

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
Olly Betts | 2 Apr 2008 05:36
Favicon
Gravatar

Google Summer of Code - application deadline extended

This doesn't seem to have been as widely publicised as I would have expected,
but the deadline for student applications has been extended by a week to April
7th:

http://code.google.com/soc/2008/

SWIG has had 9 applications so far.  While 9 is more than we can mentor or are
likely to be allocated slots for, most of the current applications really need
more work.  So if you are a student, interested in working on SWIG, are keen and
motivated, and can put together a good quality application, it's still not too
late.  I would recommend not leaving your application to the last minute though
- I doubt the deadline will be extended a second time!

We've haven't yet had any applications at all for project suggestion #5 (adding
directors for a language which doesn't have them currently):

http://www.dabeaz.com/cgi-bin/wiki.pl?DeveloperInfo/GoogleSummerOfCode

We also welcome your own ideas for SWIG-based projects.

We encourage you to discuss projects with us before submitting an application. 
Either on the mailing list, or on IRC (#swig-gsoc on FreeNode, or #swig on
OFTC).  Do remember that we may not be in the same timezone as you, so don't
expect an instant response on IRC!

Cheers,
    Olly

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
Daniel Oberlin | 2 Apr 2008 14:54

Giving member field semantics to C++ style accessor functions

Hello SWIG List,

 

I have a question which I could not answer in the SWIG documentation.  I am using SWIG 1.34 to wrap C++ code for Python and C#.

 

I have some C++ accessor functions – for example:

 

void SetValue(int value);

int GetValue();

 

and I would like for SWIG to present these setters and getters to the target language with member field semantics:

 

setting:

obj.Value = 34

 

getting:

v = obj.Value

 

Is there a way to do this conveniently using SWIG?

 

So far I have been extremely impressed with SWIG as a tool.  It is very powerful and comprehensive.

 

Sincerely,

Dan

Daniel M. Oberlin
CambridgeSoft Corporation
100 CambridgePark Drive
Cambridge, MA 02140 USA
617.259.9959
dmo <at> cambridgesoft.com

 

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Swig-user mailing list
Swig-user <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/swig-user
Xavier Delacour | 2 Apr 2008 15:02
Picon

Re: Giving member field semantics to C++ style accessor functions

I think typemaps/attribute.swg does what you want.

Given an interface:

%include <attribute.swg>
%attribute(A, int, a, get_a, set_a);
struct A
{
  int get_a() const;
  void set_a(int aa);
};

You'll get usage:

x = A()
x.a = 3        # calls A::set_a
print x.a      # calls A::get_a

Xavier

On Wed, Apr 2, 2008 at 8:54 AM, Daniel Oberlin
<DOberlin <at> cambridgesoft.com> wrote:
>
>
>
>
> Hello SWIG List,
>
>
>
> I have a question which I could not answer in the SWIG documentation.  I am
> using SWIG 1.34 to wrap C++ code for Python and C#.
>
>
>
> I have some C++ accessor functions – for example:
>
>
>
> void SetValue(int value);
>
> int GetValue();
>
>
>
> and I would like for SWIG to present these setters and getters to the target
> language with member field semantics:
>
>
>
> setting:
>
> obj.Value = 34
>
>
>
> getting:
>
> v = obj.Value
>
>
>
> Is there a way to do this conveniently using SWIG?
>
>
>
> So far I have been extremely impressed with SWIG as a tool.  It is very
> powerful and comprehensive.
>
>
>
> Sincerely,
>
> Dan
>
> Daniel M. Oberlin
>  CambridgeSoft Corporation
>  100 CambridgePark Drive
>  Cambridge, MA 02140 USA
>  617.259.9959
>  dmo <at> cambridgesoft.com
>
>
> -------------------------------------------------------------------------
>  Check out the new SourceForge.net Marketplace.
>  It's the best place to buy or sell services for
>  just about anything Open Source.
>
> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
> _______________________________________________
>  Swig-user mailing list
>  Swig-user <at> lists.sourceforge.net
>  https://lists.sourceforge.net/lists/listinfo/swig-user
>
>

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
Xavier Delacour | 2 Apr 2008 15:20
Picon

Re: Giving member field semantics to C++ style accessor functions

It seems it'll hide the original accessors, per:

  %ignore Class::GetMethod();
  %ignore Class::GetMethod() const;
  #if #SetMethod != #AttributeName
    %ignore Class::SetMethod;
  #endif

You could copy the attribute.swg file into your own project and remove
these, or make them optional somehow and submit a patch.

Xavier

On Wed, Apr 2, 2008 at 9:07 AM, Daniel Oberlin
<DOberlin <at> cambridgesoft.com> wrote:
> Xavier,
>
>  Thank you for your very quick response!
>
>  I don't think that this is in the web documentation, or I would have
>  seen it.
>
>  Does this also hide the original accessor functions get_a() and set_a(),
>  or are these still available?
>
>  Thanks,
>
> Dan
>
>  Daniel M. Oberlin
>  CambridgeSoft Corporation
>  100 CambridgePark Drive
>  Cambridge, MA 02140 USA
>  617.259.9959
>  dmo <at> cambridgesoft.com
>
>
>
>
> -----Original Message-----
>  From: Xavier Delacour [mailto:xavier.delacour <at> gmail.com]
>  Sent: Wednesday, April 02, 2008 9:02 AM
>  To: Daniel Oberlin
>  Cc: swig-user <at> lists.sourceforge.net
>  Subject: Re: [Swig-user] Giving member field semantics to C++ style
>  accessor functions
>
>  I think typemaps/attribute.swg does what you want.
>
>  Given an interface:
>
>  %include <attribute.swg>
>  %attribute(A, int, a, get_a, set_a);
>  struct A
>  {
>   int get_a() const;
>   void set_a(int aa);
>  };
>
>  You'll get usage:
>
>  x = A()
>  x.a = 3        # calls A::set_a
>  print x.a      # calls A::get_a
>
>  Xavier
>
>  On Wed, Apr 2, 2008 at 8:54 AM, Daniel Oberlin
>  <DOberlin <at> cambridgesoft.com> wrote:
>  >
>  >
>  >
>  >
>  > Hello SWIG List,
>  >
>  >
>  >
>  > I have a question which I could not answer in the SWIG documentation.
>  I am
>  > using SWIG 1.34 to wrap C++ code for Python and C#.
>  >
>  >
>  >
>  > I have some C++ accessor functions - for example:
>  >
>  >
>  >
>  > void SetValue(int value);
>  >
>  > int GetValue();
>  >
>  >
>  >
>  > and I would like for SWIG to present these setters and getters to the
>  target
>  > language with member field semantics:
>  >
>  >
>  >
>  > setting:
>  >
>  > obj.Value = 34
>  >
>  >
>  >
>  > getting:
>  >
>  > v = obj.Value
>  >
>  >
>  >
>  > Is there a way to do this conveniently using SWIG?
>  >
>  >
>  >
>  > So far I have been extremely impressed with SWIG as a tool.  It is
>  very
>  > powerful and comprehensive.
>  >
>  >
>  >
>  > Sincerely,
>  >
>  > Dan
>  >
>  > Daniel M. Oberlin
>  >  CambridgeSoft Corporation
>  >  100 CambridgePark Drive
>  >  Cambridge, MA 02140 USA
>  >  617.259.9959
>  >  dmo <at> cambridgesoft.com
>  >
>  >
>  >
>  ------------------------------------------------------------------------
>  -
>  >  Check out the new SourceForge.net Marketplace.
>  >  It's the best place to buy or sell services for
>  >  just about anything Open Source.
>  >
>  >
>  http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketp
>  lace
>  > _______________________________________________
>  >  Swig-user mailing list
>  >  Swig-user <at> lists.sourceforge.net
>  >  https://lists.sourceforge.net/lists/listinfo/swig-user
>  >
>  >
>

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
Daniel Oberlin | 2 Apr 2008 15:22

Re: Giving member field semantics to C++ style accessor functions

I prefer the original accessors to be hidden, so the default behavior is
exactly what I am looking for.

This is great.  Thank you very much!

Dan

Daniel M. Oberlin
CambridgeSoft Corporation
100 CambridgePark Drive
Cambridge, MA 02140 USA
617.259.9959
dmo <at> cambridgesoft.com

-----Original Message-----
From: Xavier Delacour [mailto:xavier.delacour <at> gmail.com] 
Sent: Wednesday, April 02, 2008 9:20 AM
To: Daniel Oberlin
Cc: swig-user <at> lists.sourceforge.net
Subject: Re: [Swig-user] Giving member field semantics to C++ style
accessor functions

It seems it'll hide the original accessors, per:

  %ignore Class::GetMethod();
  %ignore Class::GetMethod() const;
  #if #SetMethod != #AttributeName
    %ignore Class::SetMethod;
  #endif

You could copy the attribute.swg file into your own project and remove
these, or make them optional somehow and submit a patch.

Xavier

On Wed, Apr 2, 2008 at 9:07 AM, Daniel Oberlin
<DOberlin <at> cambridgesoft.com> wrote:
> Xavier,
>
>  Thank you for your very quick response!
>
>  I don't think that this is in the web documentation, or I would have
>  seen it.
>
>  Does this also hide the original accessor functions get_a() and
set_a(),
>  or are these still available?
>
>  Thanks,
>
> Dan
>
>  Daniel M. Oberlin
>  CambridgeSoft Corporation
>  100 CambridgePark Drive
>  Cambridge, MA 02140 USA
>  617.259.9959
>  dmo <at> cambridgesoft.com
>
>
>
>
> -----Original Message-----
>  From: Xavier Delacour [mailto:xavier.delacour <at> gmail.com]
>  Sent: Wednesday, April 02, 2008 9:02 AM
>  To: Daniel Oberlin
>  Cc: swig-user <at> lists.sourceforge.net
>  Subject: Re: [Swig-user] Giving member field semantics to C++ style
>  accessor functions
>
>  I think typemaps/attribute.swg does what you want.
>
>  Given an interface:
>
>  %include <attribute.swg>
>  %attribute(A, int, a, get_a, set_a);
>  struct A
>  {
>   int get_a() const;
>   void set_a(int aa);
>  };
>
>  You'll get usage:
>
>  x = A()
>  x.a = 3        # calls A::set_a
>  print x.a      # calls A::get_a
>
>  Xavier
>
>  On Wed, Apr 2, 2008 at 8:54 AM, Daniel Oberlin
>  <DOberlin <at> cambridgesoft.com> wrote:
>  >
>  >
>  >
>  >
>  > Hello SWIG List,
>  >
>  >
>  >
>  > I have a question which I could not answer in the SWIG
documentation.
>  I am
>  > using SWIG 1.34 to wrap C++ code for Python and C#.
>  >
>  >
>  >
>  > I have some C++ accessor functions - for example:
>  >
>  >
>  >
>  > void SetValue(int value);
>  >
>  > int GetValue();
>  >
>  >
>  >
>  > and I would like for SWIG to present these setters and getters to
the
>  target
>  > language with member field semantics:
>  >
>  >
>  >
>  > setting:
>  >
>  > obj.Value = 34
>  >
>  >
>  >
>  > getting:
>  >
>  > v = obj.Value
>  >
>  >
>  >
>  > Is there a way to do this conveniently using SWIG?
>  >
>  >
>  >
>  > So far I have been extremely impressed with SWIG as a tool.  It is
>  very
>  > powerful and comprehensive.
>  >
>  >
>  >
>  > Sincerely,
>  >
>  > Dan
>  >
>  > Daniel M. Oberlin
>  >  CambridgeSoft Corporation
>  >  100 CambridgePark Drive
>  >  Cambridge, MA 02140 USA
>  >  617.259.9959
>  >  dmo <at> cambridgesoft.com
>  >
>  >
>  >
>
------------------------------------------------------------------------
>  -
>  >  Check out the new SourceForge.net Marketplace.
>  >  It's the best place to buy or sell services for
>  >  just about anything Open Source.
>  >
>  >
>
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketp
>  lace
>  > _______________________________________________
>  >  Swig-user mailing list
>  >  Swig-user <at> lists.sourceforge.net
>  >  https://lists.sourceforge.net/lists/listinfo/swig-user
>  >
>  >
>

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace

Gmane