Jump to page: 1 2
Thread overview
wxD 0.03 (Win/Gtk/Mac)
Jan 04, 2006
Fredrik Olsson
Jan 05, 2006
Fredrik Olsson
Jan 05, 2006
Fredrik Olsson
Jan 04, 2006
S. Chancellor
Jan 05, 2006
S. Chancellor
Jan 04, 2006
Juan Jose Comellas
Jan 05, 2006
BERO
Jan 16, 2006
Craig Black
Jan 16, 2006
Craig Black
January 01, 2006
wxD, the wxWidgets bindings for D have been
updated from wxWidgets 2.5 to wxWidgets 2.6:

See http://wxd.sourceforge.net/   (wxD 0.03)


There is now also better support for Unix
builds, both Linux/GTK+ and Mac OS X tested.

Additionally it now also works with wxWidgets
compiled in the "unicode" (i.e. wchar_t) mode.


wxWidgets is a very mature C++ GUI toolkit, the
wxD bindings are based on the "wx.NET" project.

See http://wxnet.sourceforge.net/ (wx for C#)


Both of wxD and wxWidgets are Free Software.
(see http://www.wxwidgets.org/newlicen.htm)

Only downside is that a D program with all the
libraries linked statically is somewhat large*...
(that is, all of: phobos, stdc++, wx, wxc, wxd)
But at least wxWidgets can be dynamically linked.

Share and Enjoy,
--anders


* around 10 megs or so, last time that I checked.
January 04, 2006
Anders F Björklund skrev:
> wxD, the wxWidgets bindings for D have been
> updated from wxWidgets 2.5 to wxWidgets 2.6:
> 
> See http://wxd.sourceforge.net/   (wxD 0.03)
> 
> 
> There is now also better support for Unix
> builds, both Linux/GTK+ and Mac OS X tested.
> 

I have tried to compile under OS X 10.4.3 as by the instructions. And I get this error log (only what I think is relevant):

===
make CXX="g++ -D__GDC__" DMD="gdmd" -C Samples
make -C Controls
gdc -c -O2 -I../.. Controls.d
gdc -o ../../bin/Controls Controls.o -L../.. -lwxd -lwxc `wx-config --libs` -lstdc++ -lcc_dynamic
/usr/bin/ld: can't locate file for: -lcc_dynamic
collect2: ld returned 1 exit status
make[2]: *** [../../bin/Controls] Error 1
make[1]: *** [all] Error 2
make: *** [all] Error 2
===

Regards
	Fredrik Olsson
January 04, 2006
Fredrik Olsson wrote:

> I have tried to compile under OS X 10.4.3 as by the instructions. And I get this error log (only what I think is relevant):

OK, hadn't tried it under Tiger yet... But you can probably get it to
work by either taking the -lcc_dynamic out, or changing it to -lgcc ?

It's in "config.Darwin", BTW.

--anders
January 04, 2006
Awesome!  Thanks alot for your effort.  I've been waiting for somebody to do this.  Why do phobos and libstdc++ need to be linked statically btw?

-S.

In article <dp8u25$72d$1@digitaldaemon.com>, =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= says...
>
>wxD, the wxWidgets bindings for D have been
>updated from wxWidgets 2.5 to wxWidgets 2.6:
>
>See http://wxd.sourceforge.net/   (wxD 0.03)
>
>
>There is now also better support for Unix
>builds, both Linux/GTK+ and Mac OS X tested.
>
>Additionally it now also works with wxWidgets
>compiled in the "unicode" (i.e. wchar_t) mode.
>
>
>wxWidgets is a very mature C++ GUI toolkit, the
>wxD bindings are based on the "wx.NET" project.
>
>See http://wxnet.sourceforge.net/ (wx for C#)
>
>
>Both of wxD and wxWidgets are Free Software.
>(see http://www.wxwidgets.org/newlicen.htm)
>
>Only downside is that a D program with all the
>libraries linked statically is somewhat large*...
>(that is, all of: phobos, stdc++, wx, wxc, wxd)
>But at least wxWidgets can be dynamically linked.
>
>Share and Enjoy,
>--anders
>
>
>* around 10 megs or so, last time that I checked.


January 04, 2006
S. Chancellor wrote:

> Awesome!  Thanks alot for your effort.  I've been waiting for somebody to do
> this.  Why do phobos and libstdc++ need to be linked statically btw?

I don't think there is any alternative, with DMD/DMC ?

For Mac OS X, C++ is static on 10.3 and dynamic on 10.4
(had forgotten that when I made the Makefile, as noted)

But what I meant is that *if* they are, it becomes big. :-)


If it's all compiled with the same C++ compiler that has
a runtime already present in the system, it can be dynamic.

Ditto for wxWidgets, as it's possible to do a "wx.framework"
or otherwise link to a dynamic shared library outside the app.

--anders
January 04, 2006
What did you use to write the C wrappers for the C++ methods? I was thinking of doing something like this for Qt, but having to write this amount of wrapper code manually looked like an insurmountable task.


Anders F Björklund wrote:

> wxD, the wxWidgets bindings for D have been
> updated from wxWidgets 2.5 to wxWidgets 2.6:
> 
> See http://wxd.sourceforge.net/   (wxD 0.03)
> 
> 
> There is now also better support for Unix
> builds, both Linux/GTK+ and Mac OS X tested.
> 
> Additionally it now also works with wxWidgets
> compiled in the "unicode" (i.e. wchar_t) mode.
> 
> 
> wxWidgets is a very mature C++ GUI toolkit, the
> wxD bindings are based on the "wx.NET" project.
> 
> See http://wxnet.sourceforge.net/ (wx for C#)
> 
> 
> Both of wxD and wxWidgets are Free Software.
> (see http://www.wxwidgets.org/newlicen.htm)
> 
> Only downside is that a D program with all the
> libraries linked statically is somewhat large*...
> (that is, all of: phobos, stdc++, wx, wxc, wxd)
> But at least wxWidgets can be dynamically linked.
> 
> Share and Enjoy,
> --anders
> 
> 
> * around 10 megs or so, last time that I checked.

January 04, 2006
> OK, hadn't tried it under Tiger yet... But you can probably get it to
> work by either taking the -lcc_dynamic out, or changing it to -lgcc ?
> 
> It's in "config.Darwin", BTW.

Tested with Tiger now, and taking it out was the way to go here...

(see http://www.algonet.se/~afb/d/wxWidgets-Minimal-Tiger.png)


So, the next version of wxD will revise the Darwin config to read:

LDFLAGS = `$(WX_CONFIG) --libs` -lstdc++ `test -r /usr/lib/libcc_dynamic.a && echo -lcc_dynamic`

This will link statically on Panther, and dynamically* on Tiger...


For Linux I will take the "-lgcc" out, since we need to use "gcc_s.so"
when using GDC as it ties into the G++ exception handling and needs it:

LDFLAGS = `$(WX_CONFIG) --libs` -lstdc++

(David answered at http://www.digitalmars.com/d/archives/D/gnu/906.html)


For the Windows version I don't think you can do anything *but* static
libraries for C++ and for wxWidgets, but found another missing config:

dmd -g -of$(TARGET) $(OBJECTS) $(TOPDIR)\wxd.lib $(TOPDIR)\wxc.lib $(WXLIBS) /EXETYPE:NT /SU:WINDOWS

That should make it stop throwing up that silly console window, I hope ?


* Linking dynamically to libstdc++ and to wxWidgets cut it down to 3 MB.
(compared to statically linked Panther version, which was more like 8 M)

But the downside of that is of course that you will now have a runtime dependency to the wxWidgets libraries with the same version... (2.6.1)

I will ship a wxWidgets "wx.framework" for Mac OS X, and RPM for Linux.
(providing shared libraries of wxWidgets, for wxD to be linking against)

The (compressed) download size of those binaries is around 2 MB or such.
(i.e. the DMG for Mac OS X and the RPM for Linux - one for each version)

You still have the option of compiling it statically, by using the Make
compile-time option like this: make WX_CONFIG="wx-config --static=yes"

--anders
January 04, 2006
Juan Jose Comellas wrote:

> What did you use to write the C wrappers for the C++ methods? I was thinking
> of doing something like this for Qt, but having to write this amount of
> wrapper code manually looked like an insurmountable task.

For wxD, the wrappers were lifted from wx.NET and tweaked a bit... :-)

But I do believe that they were originally created using "SWIG" ?
(See http://www.swig.org/)

Download the wx.NET distribution, and it should have some clues in it.

--anders
January 05, 2006
Juan Jose Comellas wrote:

>What did you use to write the C wrappers for the C++ methods? I was thinking
>of doing something like this for Qt, but having to write this amount of
>wrapper code manually looked like an insurmountable task.
>
>
>Anders F Björklund wrote:
>  
>
I was taken it from wx.NET,
it is separeted as C++ to C wrapper (wx-c) and C to C# wrapper (wx.NET)
wxD use wx-c , and convert C# part to D using perl script and/or modify by hand.

I think you can use same way.
using Qt#
http://qtcsharp.sourceforge.net/

it is separeted as C++ to C wrapper (qtc) and C to C# wrapper (qtsharp)
so "C wrappers for the C++ methods" is already exists.

BERO
January 05, 2006
BERO wrote:

> I was taken it from wx.NET,
> it is separeted as C++ to C wrapper (wx-c) and C to C# wrapper (wx.NET)
> wxD use wx-c , and convert C# part to D using perl script and/or modify by hand.

Actually it seemed that wx-c didn't fully use SWIG either, but Perl too.

(background info: wxD version I posted is just a minor update to BERO's)

> I think you can use same way.
> using Qt#
> http://qtcsharp.sourceforge.net/
> 
> it is separeted as C++ to C wrapper (qtc) and C to C# wrapper (qtsharp)
> so "C wrappers for the C++ methods" is already exists.

Seems like it (Qt#) has some problems with Windows and Mac OS X, though?

So I think I will stick with wxWidgets... It has a better license too...
(from http://doc.trolltech.com/4.1/aboutqt.html, it's GPL or *000 euros)

--anders
« First   ‹ Prev
1 2