www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - Announcing: D support in SWIG

reply klickverbot <see klickverbot.at> writes:
In a nutshell, SWIG is a »glue code« generator, allowing you to access 
C/C++ libraries from various target languages, including C#, Go, Java, 
Ruby, Python … and, since I merged my work into SWIG trunk a few days 
ago, also D, both version 1 and 2.

I have put up a short description of it at my blog 
(http://klickverbot.at/blog/2010/11/announcing-d-support-in-swig/), but 
to give it a whirl, just head over to the SWIG SVN and build it from 
there (http://swig.org/svn.html).

I would be glad if some brave souls could go ahead and test it in 
real-world use cases before it is officially released with SWIG for the 
first time (SWIG 2.0.2, date yet to be determined), so that any major 
bugs can be ironed out before.

If you have any questions or suggestions, feel free to post them here, 
drop me a line, or ask right away in #D at freenode. While I am quite 
busy at the moment, I'd be happy to help you with any issues 
(particularly happy if they concern the SWIG side of implementing 
enhancements, obviously, but also simple usage questions). Besides that, 
as always, it would be nice just to hear about what you are using this for.

Happy coding,
David
Nov 21 2010
next sibling parent BCS <anon anon.com> writes:
Hello klickverbot,

 In a nutshell, SWIG is a glue code generator, allowing you to access
 C/C++ libraries from various target languages, including C#, Go, Java,
 Ruby, Python . and, since I merged my work into SWIG trunk a few days
 ago, also D, both version 1 and 2.
 

I'm so tempted to go learn Go so I can write a program that's half D, half Go and some SWIG to tie the two together.
Nov 21 2010
prev sibling next sibling parent Fawzi Mohamed <fawzi gmx.ch> writes:
On 21-nov-10, at 18:27, klickverbot wrote:

 In a nutshell, SWIG is a =BBglue code=AB generator, allowing you to =20=

 access C/C++ libraries from various target languages, including C#, =20=

 Go, Java, Ruby, Python =85 and, since I merged my work into SWIG trunk =

 a few days ago, also D, both version 1 and 2.

 I have put up a short description of it at my blog =

 ), but to give it a whirl, just head over to the SWIG SVN and build =20=

 it from there (http://swig.org/svn.html).

 I would be glad if some brave souls could go ahead and test it in =20
 real-world use cases before it is officially released with SWIG for =20=

 the first time (SWIG 2.0.2, date yet to be determined), so that any =20=

 major bugs can be ironed out before.

 If you have any questions or suggestions, feel free to post them =20
 here, drop me a line, or ask right away in #D at freenode. While I =20
 am quite busy at the moment, I'd be happy to help you with any =20
 issues (particularly happy if they concern the SWIG side of =20
 implementing enhancements, obviously, but also simple usage =20
 questions). Besides that, as always, it would be nice just to hear =20
 about what you are using this for.

 Happy coding,
 David

nice work David, I was following your github repository, nice that you =20= made into the official repository. Fawzi
Nov 22 2010
prev sibling next sibling parent reply BLS <windevguy hotmail.de> writes:
Hi David,
let me shake your hands and say Thank You, GREAT work.

It was a bit difficult to build SWIG SVN on Windows. However. it was 
doable and as soon as I have some free time I will try make a few tests 
on a Win C++ GUI project.
Bjoern

On 21/11/2010 18:27, klickverbot wrote:
 In a nutshell, SWIG is a »glue code« generator, allowing you to access
 C/C++ libraries from various target languages, including C#, Go, Java,
 Ruby, Python … and, since I merged my work into SWIG trunk a few days
 ago, also D, both version 1 and 2.

 I have put up a short description of it at my blog
 (http://klickverbot.at/blog/2010/11/announcing-d-support-in-swig/), but
 to give it a whirl, just head over to the SWIG SVN and build it from
 there (http://swig.org/svn.html).

 I would be glad if some brave souls could go ahead and test it in
 real-world use cases before it is officially released with SWIG for the
 first time (SWIG 2.0.2, date yet to be determined), so that any major
 bugs can be ironed out before.

 If you have any questions or suggestions, feel free to post them here,
 drop me a line, or ask right away in #D at freenode. While I am quite
 busy at the moment, I'd be happy to help you with any issues
 (particularly happy if they concern the SWIG side of implementing
 enhancements, obviously, but also simple usage questions). Besides that,
 as always, it would be nice just to hear about what you are using this for.

 Happy coding,
 David

Nov 24 2010
next sibling parent reply BLS <windevguy hotmail.de> writes:
On 08/12/2010 18:48, Andrej Mitrovic wrote:
 On 11/24/10, BLS<windevguy hotmail.de>  wrote:
 Hi David,
 let me shake your hands and say Thank You, GREAT work.

 It was a bit difficult to build SWIG SVN on Windows.

Just finding those automake/autoconf/bison binaries is a detectives' work. How did u build from svn?

If I recall correctly, I've just installed MinGW, and MSYS calling svn, make,makeinstall. There was however a problem with pcre (I am using 8.10) I found the solution by reading the error message from make regarding pcre very careful. Sorry that all I can tell you atm. beside, to start msys via menu look for MinGW Shell hth bjoern
Dec 08 2010
next sibling parent reply klickverbot <see klickverbot.at> writes:
On 12/9/10 10:12 PM, Andrej Mitrovic wrote:
 I'm curious, can you use SWIG with D2 on Linux as well? From what I've
 read so far in the docs, SWIG creates an extension module that can be
 compiled as a dynamic library. But afaik there are some issues with
 using dynamic libs in Linux with D2, at least that's what I've read a
 few times in the newsgroups..

What's compiled as a dynamic library is the C/C++ wrapper layer, but the issues are related to writing dynamic libraries in D. By the way, the wrapper library could be linked statically as well (I'll implement that as soon as I have some time to spare), but due to the COFF/OMF issues on Windows, I decided to default to dynamic loading.
Dec 09 2010
parent reply BLS <windevguy hotmail.de> writes:
On 09/12/2010 23:47, Andrej Mitrovic wrote:
 I'm thinking maybe we should have a SWIG interfaces project on
 dsource, if one doesn't exist yet. If someone made SWIG interfaces for
 some big library it would be cool to share it at one place so anyone
 could download them.

Vote++ A discussion Forum would be nice too. I am just trying to figure out what to do with : operator HWND() const;
Dec 09 2010
next sibling parent reply klickverbot <see klickverbot.at> writes:
On 12/10/10 12:12 AM, BLS wrote:
 Vote++ A discussion Forum would be nice too.
 I am just trying to figure out what to do with :

 operator HWND() const;

Any suggestions on that? The previous attempt for D support in SWIG (which became unmaintained at a rather early stage and didn't make its way into the SWIG core distribution) had a project at DSource [1], but although I really appreciate all the effort that went into it and the great service it has been providing for a really long time now, I am not sure if DSource is the way to go for this kind of effort. For example, DSource seems to be surrounded by a cloud of bad karma lately – lots of dead or obsolete projects, very busy admin(s), server outages, etc. Also, a possible DSource project wouldn't really have a common source code base, at least I wouldn't want to maintain a collection of SWIG interface files for specific libraries I probably don't even use myself. Another thing is that since D support is an official part of SWIG now, there are also the official communication channels (SF.net tracker, the swig-user ML, etc.). These questions make me wonder if it would be a better idea to use separate repositories for each library binding, probably at some DVCS site where projects are easily forkable (like GitHub, Bitbucket and the likes), and keep a central page/thread somewhere with links to the individual projects. Discussing SWIG and D is an entirely different topic, for which there are many possible options: a newly created digitalmars.D.bindings NG, a forum hosted somewhere (DSource, …), Stackoverflow (tagged »swig« and »d« or maybe even »swig-d«), the Swig-user mailing list, and probably a few more I didn't think of right now. Regarding your specific problem: Generally speaking, operator overloading is WIP (hopefully I find time to implement it for D2 during the weekend), but implicit conversions can't really be mapped to D anyway, so just use the %rename directive of SWIG to map the implicit conversion operator to a regular member function like »asHwnd()«. [1] http://dsource.org/projects/swig4d
Dec 09 2010
next sibling parent BLS <windevguy hotmail.de> writes:
On 10/12/2010 01:27, klickverbot wrote:
 Regarding your specific problem: Generally speaking, operator
 overloading is WIP (hopefully I find time to implement it for D2 during
 the weekend), but implicit conversions can't really be mapped to D
 anyway, so just use the %rename directive of SWIG to map the implicit
 conversion operator to a regular member function like »asHwnd()«.

Whatever it is, or will be, I don't care. It is just that IMHO we need a discussion platform. I think it is not an egoistic point of view to ask for support. I guess serious questions will make SWIG 4 D more reliable. Just a suggestion : why not use the D WIKI for FAQ, Documentation links and HOW TO s. I would further like to suggest that we! add a real world windows_sample.i plus windows_sample.h file in order to explain how to deal with HWND, LPCTSTR, DWORD respective CWnd* GetCWndFromMap(HWND hWnd); etc.. will send you a short(promised) email David Once again, thanks for such a nice piece of work. Bjoern
Dec 09 2010
prev sibling parent BLS <windevguy hotmail.de> writes:
On 10/12/2010 01:27, klickverbot wrote:
 Regarding your specific problem: Generally speaking, operator
 overloading is WIP (hopefully I find time to implement it for D2 during
 the weekend), but implicit conversions can't really be mapped to D
 anyway, so just use the %rename directive of SWIG to map the implicit
 conversion operator to a regular member function like »asHwnd()«.

Using the %rename directive sound reasonable... I'll give it a try. thanks, bjoern
Dec 09 2010
prev sibling parent klickverbot <see klickverbot.at> writes:
On 12/10/10 12:49 AM, Andrej Mitrovic wrote:
 […]  Thanks for writing
 that D-specific documentation, klickverbot!

Well, as for most small-scale OSS projects, writing good docs is pretty boring when you can hack right away on some code as well, so I could really need some suggestions on the D specific parts. For instance, the D chapter desperately needs some small examples that demonstrate how all the customization features of SWIG play together to wrap the most common types of C/C++ APIs, e.g. converting return values to exceptions via custom dptype/dout typemap, renaming cast operators, injecting additional code into the generated D layer to construct more abstract proxy objects of some sorts, etc…
Dec 09 2010
prev sibling parent BLS <windevguy hotmail.de> writes:
On 08/12/2010 20:35, Andrej Mitrovic wrote:
 I did a configure with:
 --with-d2-compiler=C:\DMD\dmd2\windows\bin\dmd.exe and make to build
 swig.

Guess you mean .. --with-d2-compiler=C:/DMD/dmd2/windows/bin/dmd.exe Bjoern
Dec 10 2010
prev sibling next sibling parent Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
Okay, got it working now.

I've installed MinGW (again) via that new mingw-get installer from
sourceforge. And I had the same error message as you, so I've
downloaded pcre-8.01.tar.bz2 from
ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/, I've put it in
my swig svn directory (C:\MinGW\msys\1.0\src\swig) and I've ran the
tools/pcre-build.sh script.

So I've ran ./configure again and make. It's building right now.

On 12/8/10, BLS <windevguy hotmail.de> wrote:
 On 08/12/2010 18:48, Andrej Mitrovic wrote:
 On 11/24/10, BLS<windevguy hotmail.de>  wrote:
 Hi David,
 let me shake your hands and say Thank You, GREAT work.

 It was a bit difficult to build SWIG SVN on Windows.

Just finding those automake/autoconf/bison binaries is a detectives' work. How did u build from svn?

If I recall correctly, I've just installed MinGW, and MSYS calling svn, make,makeinstall. There was however a problem with pcre (I am using 8.10) I found the solution by reading the error message from make regarding pcre very careful. Sorry that all I can tell you atm. beside, to start msys via menu look for MinGW Shell hth bjoern

Dec 08 2010
prev sibling next sibling parent Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
Am I supossed to use
--with-d2-compiler=C:\DMD\dmd2\windows\bin\dmd.exe or just
--with-d2-compiler=C:\DMD\ path when calling configure?

On 12/8/10, Andrej Mitrovic <andrej.mitrovich gmail.com> wrote:
 Okay, got it working now.

 I've installed MinGW (again) via that new mingw-get installer from
 sourceforge. And I had the same error message as you, so I've
 downloaded pcre-8.01.tar.bz2 from
 ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/, I've put it in
 my swig svn directory (C:\MinGW\msys\1.0\src\swig) and I've ran the
 tools/pcre-build.sh script.

 So I've ran ./configure again and make. It's building right now.

 On 12/8/10, BLS <windevguy hotmail.de> wrote:
 On 08/12/2010 18:48, Andrej Mitrovic wrote:
 On 11/24/10, BLS<windevguy hotmail.de>  wrote:
 Hi David,
 let me shake your hands and say Thank You, GREAT work.

 It was a bit difficult to build SWIG SVN on Windows.

Just finding those automake/autoconf/bison binaries is a detectives' work. How did u build from svn?

If I recall correctly, I've just installed MinGW, and MSYS calling svn, make,makeinstall. There was however a problem with pcre (I am using 8.10) I found the solution by reading the error message from make regarding pcre very careful. Sorry that all I can tell you atm. beside, to start msys via menu look for MinGW Shell hth bjoern


Dec 08 2010
prev sibling next sibling parent Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
Hey hey, good news, got it all working now.

I did a configure with:
--with-d2-compiler=C:\DMD\dmd2\windows\bin\dmd.exe and make to build
swig.

Then I've ran one example in:
C:\MinGW\msys\1.0\src\swig\Examples\d\class\ with: make D_VERSION=2 .
It builds and runs fine.

I've only tried one example, but great work klickverbot!!

On 12/8/10, Andrej Mitrovic <andrej.mitrovich gmail.com> wrote:
 Am I supossed to use
 --with-d2-compiler=C:\DMD\dmd2\windows\bin\dmd.exe or just
 --with-d2-compiler=C:\DMD\ path when calling configure?

 On 12/8/10, Andrej Mitrovic <andrej.mitrovich gmail.com> wrote:
 Okay, got it working now.

 I've installed MinGW (again) via that new mingw-get installer from
 sourceforge. And I had the same error message as you, so I've
 downloaded pcre-8.01.tar.bz2 from
 ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/, I've put it in
 my swig svn directory (C:\MinGW\msys\1.0\src\swig) and I've ran the
 tools/pcre-build.sh script.

 So I've ran ./configure again and make. It's building right now.

 On 12/8/10, BLS <windevguy hotmail.de> wrote:
 On 08/12/2010 18:48, Andrej Mitrovic wrote:
 On 11/24/10, BLS<windevguy hotmail.de>  wrote:
 Hi David,
 let me shake your hands and say Thank You, GREAT work.

 It was a bit difficult to build SWIG SVN on Windows.

Just finding those automake/autoconf/bison binaries is a detectives' work. How did u build from svn?

If I recall correctly, I've just installed MinGW, and MSYS calling svn, make,makeinstall. There was however a problem with pcre (I am using 8.10) I found the solution by reading the error message from make regarding pcre very careful. Sorry that all I can tell you atm. beside, to start msys via menu look for MinGW Shell hth bjoern



Dec 08 2010
prev sibling next sibling parent Jimmy Cao <jcao219 gmail.com> writes:
--0016368e2051d7a5420496ed7a01
Content-Type: text/plain; charset=ISO-8859-1

I've been trying to wrap Irrlicht with this (on Windows) lately.  Things are
working well.

On Wed, Dec 8, 2010 at 1:35 PM, Andrej Mitrovic
<andrej.mitrovich gmail.com>wrote:

 Hey hey, good news, got it all working now.

 I did a configure with:
 --with-d2-compiler=C:\DMD\dmd2\windows\bin\dmd.exe and make to build
 swig.

 Then I've ran one example in:
 C:\MinGW\msys\1.0\src\swig\Examples\d\class\ with: make D_VERSION=2 .
 It builds and runs fine.

 I've only tried one example, but great work klickverbot!!

 On 12/8/10, Andrej Mitrovic <andrej.mitrovich gmail.com> wrote:
 Am I supossed to use
 --with-d2-compiler=C:\DMD\dmd2\windows\bin\dmd.exe or just
 --with-d2-compiler=C:\DMD\ path when calling configure?

 On 12/8/10, Andrej Mitrovic <andrej.mitrovich gmail.com> wrote:
 Okay, got it working now.

 I've installed MinGW (again) via that new mingw-get installer from
 sourceforge. And I had the same error message as you, so I've
 downloaded pcre-8.01.tar.bz2 from
 ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/, I've put it in
 my swig svn directory (C:\MinGW\msys\1.0\src\swig) and I've ran the
 tools/pcre-build.sh script.

 So I've ran ./configure again and make. It's building right now.

 On 12/8/10, BLS <windevguy hotmail.de> wrote:
 On 08/12/2010 18:48, Andrej Mitrovic wrote:
 On 11/24/10, BLS<windevguy hotmail.de>  wrote:
 Hi David,
 let me shake your hands and say Thank You, GREAT work.

 It was a bit difficult to build SWIG SVN on Windows.

Just finding those automake/autoconf/bison binaries is a detectives' work. How did u build from svn?

If I recall correctly, I've just installed MinGW, and MSYS calling svn, make,makeinstall. There was however a problem with pcre (I am using 8.10) I found the solution by reading the error message from make regarding pcre very careful. Sorry that all I can tell you atm. beside, to start msys via menu look for MinGW Shell hth bjoern




--0016368e2051d7a5420496ed7a01 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I&#39;ve been trying to wrap Irrlicht with this (on Windows) lately. =A0Thi= ngs are working well.<br><br><div class=3D"gmail_quote">On Wed, Dec 8, 2010= at 1:35 PM, Andrej Mitrovic <span dir=3D"ltr">&lt;<a href=3D"mailto:andrej= .mitrovich gmail.com">andrej.mitrovich gmail.com</a>&gt;</span> wrote:<br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex;">Hey hey, good news, got it all working now.= <br> <br> I did a configure with:<br> --with-d2-compiler=3DC:\DMD\dmd2\windows\bin\dmd.exe and make to build<br> swig.<br> <br> Then I&#39;ve ran one example in:<br> C:\MinGW\msys\1.0\src\swig\Examples\d\class\ with: make D_VERSION=3D2 .<br> It builds and runs fine.<br> <br> I&#39;ve only tried one example, but great work klickverbot!!<br> <div><div></div><div class=3D"h5"><br> On 12/8/10, Andrej Mitrovic &lt;<a href=3D"mailto:andrej.mitrovich gmail.co= m">andrej.mitrovich gmail.com</a>&gt; wrote:<br> &gt; Am I supossed to use<br> &gt; --with-d2-compiler=3DC:\DMD\dmd2\windows\bin\dmd.exe or just<br> &gt; --with-d2-compiler=3DC:\DMD\ path when calling configure?<br> &gt;<br> &gt; On 12/8/10, Andrej Mitrovic &lt;<a href=3D"mailto:andrej.mitrovich gma= il.com">andrej.mitrovich gmail.com</a>&gt; wrote:<br> &gt;&gt; Okay, got it working now.<br> &gt;&gt;<br> &gt;&gt; I&#39;ve installed MinGW (again) via that new mingw-get installer = from<br> &gt;&gt; sourceforge. And I had the same error message as you, so I&#39;ve<= br> &gt;&gt; downloaded pcre-8.01.tar.bz2 from<br> &gt;&gt; <a href=3D"ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/"= target=3D"_blank">ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/</= a>, I&#39;ve put it in<br> &gt;&gt; my swig svn directory (C:\MinGW\msys\1.0\src\swig) and I&#39;ve ra= n the<br> &gt;&gt; tools/pcre-build.sh script.<br> &gt;&gt;<br> &gt;&gt; So I&#39;ve ran ./configure again and make. It&#39;s building righ= t now.<br> &gt;&gt;<br> &gt;&gt; On 12/8/10, BLS &lt;<a href=3D"mailto:windevguy hotmail.de">windev= guy hotmail.de</a>&gt; wrote:<br> &gt;&gt;&gt; On 08/12/2010 18:48, Andrej Mitrovic wrote:<br> &gt;&gt;&gt;&gt; On 11/24/10, BLS&lt;<a href=3D"mailto:windevguy hotmail.de= ">windevguy hotmail.de</a>&gt; =A0wrote:<br> &gt;&gt;&gt;&gt;&gt; Hi David,<br> &gt;&gt;&gt;&gt;&gt; let me shake your hands and say Thank You, GREAT work.= <br> &gt;&gt;&gt;&gt;&gt;<br> &gt;&gt;&gt;&gt;&gt; It was a bit difficult to build SWIG SVN on Windows.<b= r> &gt;&gt;&gt;&gt;<br> &gt;&gt;&gt;&gt; Just finding those automake/autoconf/bison binaries is a d= etectives&#39;<br> &gt;&gt;&gt;&gt; work.<br> &gt;&gt;&gt;&gt;<br> &gt;&gt;&gt;&gt; How did u build from svn?<br> &gt;&gt;&gt;<br> &gt;&gt;&gt; If I recall correctly, I&#39;ve just installed MinGW, and MSYS= <br> &gt;&gt;&gt; calling svn, make,makeinstall. There was however a problem wit= h pcre (I<br> &gt;&gt;&gt; am using 8.10) I found the solution by reading the error messa= ge from<br> &gt;&gt;&gt; make regarding pcre very careful. Sorry that all I can tell yo= u atm.<br> &gt;&gt;&gt; beside, to start msys via menu look for MinGW Shell<br> &gt;&gt;&gt; hth bjoern<br> &gt;&gt;&gt;<br> &gt;&gt;<br> &gt;<br> </div></div></blockquote></div><br> --0016368e2051d7a5420496ed7a01--
Dec 08 2010
prev sibling next sibling parent Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
I'm curious, can you use SWIG with D2 on Linux as well? From what I've
read so far in the docs, SWIG creates an extension module that can be
compiled as a dynamic library. But afaik there are some issues with
using dynamic libs in Linux with D2, at least that's what I've read a
few times in the newsgroups..

All of the examples work fine on windows, though. :)

On 12/8/10, Jimmy Cao <jcao219 gmail.com> wrote:
 I've been trying to wrap Irrlicht with this (on Windows) lately.  Things are
 working well.

 On Wed, Dec 8, 2010 at 1:35 PM, Andrej Mitrovic
 <andrej.mitrovich gmail.com>wrote:

 Hey hey, good news, got it all working now.

 I did a configure with:
 --with-d2-compiler=C:\DMD\dmd2\windows\bin\dmd.exe and make to build
 swig.

 Then I've ran one example in:
 C:\MinGW\msys\1.0\src\swig\Examples\d\class\ with: make D_VERSION=2 .
 It builds and runs fine.

 I've only tried one example, but great work klickverbot!!

 On 12/8/10, Andrej Mitrovic <andrej.mitrovich gmail.com> wrote:
 Am I supossed to use
 --with-d2-compiler=C:\DMD\dmd2\windows\bin\dmd.exe or just
 --with-d2-compiler=C:\DMD\ path when calling configure?

 On 12/8/10, Andrej Mitrovic <andrej.mitrovich gmail.com> wrote:
 Okay, got it working now.

 I've installed MinGW (again) via that new mingw-get installer from
 sourceforge. And I had the same error message as you, so I've
 downloaded pcre-8.01.tar.bz2 from
 ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/, I've put it in
 my swig svn directory (C:\MinGW\msys\1.0\src\swig) and I've ran the
 tools/pcre-build.sh script.

 So I've ran ./configure again and make. It's building right now.

 On 12/8/10, BLS <windevguy hotmail.de> wrote:
 On 08/12/2010 18:48, Andrej Mitrovic wrote:
 On 11/24/10, BLS<windevguy hotmail.de>  wrote:
 Hi David,
 let me shake your hands and say Thank You, GREAT work.

 It was a bit difficult to build SWIG SVN on Windows.

Just finding those automake/autoconf/bison binaries is a detectives' work. How did u build from svn?

If I recall correctly, I've just installed MinGW, and MSYS calling svn, make,makeinstall. There was however a problem with pcre (I am using 8.10) I found the solution by reading the error message from make regarding pcre very careful. Sorry that all I can tell you atm. beside, to start msys via menu look for MinGW Shell hth bjoern





Dec 09 2010
prev sibling next sibling parent Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
I'm thinking maybe we should have a SWIG interfaces project on
dsource, if one doesn't exist yet. If someone made SWIG interfaces for
some big library it would be cool to share it at one place so anyone
could download them.

On 12/9/10, klickverbot <see klickverbot.at> wrote:
 On 12/9/10 10:12 PM, Andrej Mitrovic wrote:
 I'm curious, can you use SWIG with D2 on Linux as well? From what I've
 read so far in the docs, SWIG creates an extension module that can be
 compiled as a dynamic library. But afaik there are some issues with
 using dynamic libs in Linux with D2, at least that's what I've read a
 few times in the newsgroups..

What's compiled as a dynamic library is the C/C++ wrapper layer, but the issues are related to writing dynamic libraries in D. By the way, the wrapper library could be linked statically as well (I'll implement that as soon as I have some time to spare), but due to the COFF/OMF issues on Windows, I decided to default to dynamic loading.

Dec 09 2010
prev sibling next sibling parent Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
I just had a 30-minute look at the documentation. There's a whole
section on interfacing with C++, so maybe you can find some help
there.

It looks pretty trivial to wrap C code (in most cases we don't even
need SWIG for C), but C++ is a different beast. Thanks for writing
that D-specific documentation, klickverbot!

On 12/10/10, BLS <windevguy hotmail.de> wrote:
 On 09/12/2010 23:47, Andrej Mitrovic wrote:
 I'm thinking maybe we should have a SWIG interfaces project on
 dsource, if one doesn't exist yet. If someone made SWIG interfaces for
 some big library it would be cool to share it at one place so anyone
 could download them.

Vote++ A discussion Forum would be nice too. I am just trying to figure out what to do with : operator HWND() const;

Dec 09 2010
prev sibling next sibling parent Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
Yeah, maybe dsource wasn't such a good idea. It does have a lot of
dead projects and nobody wants to put up categories to split up D1/D2
projects (and the forums are sloooow).

Maybe a better solution is to just add any new interfaces to a D Wiki
page   http://www.prowiki.org/wiki4d/wiki.cgi

On 12/10/10, BLS <windevguy hotmail.de> wrote:
 On 10/12/2010 01:27, klickverbot wrote:
 Discussing SWIG and D is an entirely different topic, for which there
 are many possible options: a newly created digitalmars.D.bindings NG, a
 forum hosted somewhere (DSource, =85), Stackoverflow (tagged =BBswig=AB =


 =BBd=AB or maybe even =BBswig-d=AB), the Swig-user mailing list, and pro=


 few more I didn't think of right now.

Whatever it is, or will be, I don't care. It is just that IMHO we need a discussion platform. I think it is not only an egoistic point view to ask for support. I guess serious questions will make SWIG 4 D more reliable. Just a suggestion : why not use the D WIKI for FAQ, Documentation links and HOW TOs. Probably we could also to publish the SWIG 4 D documentation=

 I would further like to suggest that we! add a real world
 windows_sample.i plus windows_sample.h file in order to explain how to
 deal with HWND, LPCTSTR, DWORD  respective
 CWnd* GetCWndFromMap(HWND hWnd); etc..

 will send you a short(promised) email David
 Once again, thanks for such a nice piece of work.
 Bjoern

Dec 09 2010
prev sibling next sibling parent Jimmy Cao <jcao219 gmail.com> writes:
--0023547c90374e6ae104970588f8
Content-Type: text/plain; charset=ISO-8859-1

On Thu, Dec 9, 2010 at 8:49 PM, BLS <windevguy hotmail.de> wrote:
 Whatever it is, or will be, I don't care. It is just that IMHO we need a
 discussion platform.

Definitely also IRC. The usual #d for now, then maybe #d.swig if there is more interest? (FreeNode) --0023547c90374e6ae104970588f8 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable <div><div class=3D"gmail_quote">On Thu, Dec 9, 2010 at 8:49 PM, BLS <span d= ir=3D"ltr">&lt;<a href=3D"mailto:windevguy hotmail.de" target=3D"_blank">wi= ndevguy hotmail.de</a>&gt;</span> wrote:<blockquote class=3D"gmail_quote" s= tyle=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> Whatever it is, or will be, I don&#39;t care. It is just that IMHO we need = a discussion platform.<br></blockquote></div></div><div><br></div><div>Defi= nitely also IRC.<div>The usual #d for now, then maybe #d.swig if there is m= ore interest?</div> </div><div>(FreeNode)</div> --0023547c90374e6ae104970588f8--
Dec 09 2010
prev sibling next sibling parent Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
On 12/10/10, BLS <windevguy hotmail.de> wrote:
 On 08/12/2010 20:35, Andrej Mitrovic wrote:
 I did a configure with:
 --with-d2-compiler=C:\DMD\dmd2\windows\bin\dmd.exe and make to build
 swig.

Guess you mean .. --with-d2-compiler=C:/DMD/dmd2/windows/bin/dmd.exe Bjoern

Backslashes worked fine for me on MSYS: ... checking for R... no checking for 6g... no checking for 8g... no checking for gccgo... no checking for dmd... dmd ...
Dec 10 2010
prev sibling parent Jimmy Cao <jcao219 gmail.com> writes:
--0023544fb8fec92fa10497551ea7
Content-Type: text/plain; charset=ISO-8859-1

Take a look:
http://irrlichtd.codeplex.com/
<http://irrlichtd.codeplex.com/>

I think this is easy and fun to do, so I'll work on it in my spare time.

--0023544fb8fec92fa10497551ea7
Content-Type: text/html; charset=ISO-8859-1

Take a look:<div><a href="http://irrlichtd.codeplex.com/"
target="_blank">http://irrlichtd.codeplex.com/</a></div><div><a
href="http://irrlichtd.codeplex.com/" target="_blank"></a></div><div><div
class="gmail_quote"><br></div>

</div><div class="gmail_quote">I think this is easy and fun to do, so I&#39;ll
work on it in my spare time.</div>

--0023544fb8fec92fa10497551ea7--
Dec 13 2010
prev sibling next sibling parent reply klickverbot <see klickverbot.at> writes:
Sorry if this might come a bit late for anybody following SWIG SVN 
trunk, but I needed to make a breaking naming change to the D module of 
SWIG to bring it more in line with the C# support.

The details, along with a sed script for fixing any custom typemaps: 
ttp://klickverbot.at/blog/2010/12/swig-d-breaking-name-changes/

This should have been the last major breaking change, at least I hope so.

David
Dec 02 2010
parent klickverbot <see klickverbot.at> writes:
On 12/2/10 6:00 PM, klickverbot wrote:
 The details, along with a sed script for fixing any custom typemaps:
 ttp://klickverbot.at/blog/2010/12/swig-d-breaking-name-changes/

Oops, there is an h missing, that should have obviously been http://klickverbot.at/blog/2010/12/swig-d-breaking-name-changes/.
Dec 02 2010
prev sibling next sibling parent Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
On 11/24/10, BLS <windevguy hotmail.de> wrote:
 Hi David,
 let me shake your hands and say Thank You, GREAT work.

 It was a bit difficult to build SWIG SVN on Windows.

Just finding those automake/autoconf/bison binaries is a detectives' work. How did u build from svn?
Dec 08 2010
prev sibling next sibling parent reply Jordi <jordi rovira.cat> writes:
Hi,

   I just wanted to drop a note to say that i have tried it and it works 
quite well. I am wrapping a small C++ library and using in my D application.

   Thanks!

j.

On 11/21/2010 06:27 PM, klickverbot wrote:
 In a nutshell, SWIG is a »glue code« generator, allowing you to access
 C/C++ libraries from various target languages, including C#, Go, Java,
 Ruby, Python … and, since I merged my work into SWIG trunk a few days
 ago, also D, both version 1 and 2.

 I have put up a short description of it at my blog
 (http://klickverbot.at/blog/2010/11/announcing-d-support-in-swig/), but
 to give it a whirl, just head over to the SWIG SVN and build it from
 there (http://swig.org/svn.html).

 I would be glad if some brave souls could go ahead and test it in
 real-world use cases before it is officially released with SWIG for the
 first time (SWIG 2.0.2, date yet to be determined), so that any major
 bugs can be ironed out before.

 If you have any questions or suggestions, feel free to post them here,
 drop me a line, or ask right away in #D at freenode. While I am quite
 busy at the moment, I'd be happy to help you with any issues
 (particularly happy if they concern the SWIG side of implementing
 enhancements, obviously, but also simple usage questions). Besides that,
 as always, it would be nice just to hear about what you are using this for.

 Happy coding,
 David

Jan 19 2011
parent reply Trass3r <un known.com> writes:
    I just wanted to drop a note to say that i have tried it and it works  
 quite well. I am wrapping a small C++ library and using in my D  
 application.

Is there a tutorial (not 50 pages of text) about what needs to be done to support a C++ library?
Jan 19 2011
parent Jordi <jordi rovira.cat> writes:
On 01/19/2011 07:16 PM, Trass3r wrote:
 I just wanted to drop a note to say that i have tried it and it works
 quite well. I am wrapping a small C++ library and using in my D
 application.

Is there a tutorial (not 50 pages of text) about what needs to be done to support a C++ library?

I don't know. As i am making the C++ library myself too, i was very careful to follow stric guidelines to make it easy to wrap. Most of it is explained in the big Swig manual, but i pressume that that is what you mean with 50+ pages :).
Jan 19 2011
prev sibling parent reply Trass3r <un known.com> writes:
Does SWIG also support turning all those crappy C++ Get*/Set* methods you can
find in almost every OOP-based project into proper D properties (incl. removing
Get/Set and turning the next letter lowercase)?
Feb 02 2011
parent David Nadlinger <see klickverbot.at> writes:
On 2/2/11 2:02 PM, Trass3r wrote:
 Does SWIG also support turning all those crappy C++ Get*/Set* methods you can
find in almost every OOP-based project into proper D properties (incl. removing
Get/Set and turning the next letter lowercase)?

There is regex-based rename support in SWIG, so this should certainly be doable – I haven't personally tried it yet, though. David
Feb 02 2011