www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - wxD 0.03 (Win/Gtk/Mac)

reply =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
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.




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.
Jan 01 2006
next sibling parent reply Fredrik Olsson <peylow treyst.se> writes:
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
Jan 04 2006
parent reply =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
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
Jan 04 2006
parent reply =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
 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
Jan 04 2006
parent reply Fredrik Olsson <peylow treyst.se> writes:
Anders F Björklund skrev:
 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)
<snip> Well, not as lucky on my part. Recompiled wxd as per instructions but get this one: 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++ /usr/bin/ld: Undefined symbols: typeinfo for wxThread ... <SNIP> ... typeinfo for wxNumberEntryDialog collect2: ld returned 1 exit status make[2]: *** [../../bin/Controls] Error 1 make[1]: *** [all] Error 2 make: *** [all] Error 2 Must wxWidgets be recompiled as well? // Fredrik Olsson
Jan 05 2006
parent reply =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
Fredrik Olsson wrote:

 Must wxWidgets be recompiled as well?
Yes, you must compile wxWidgets with the same C++ version as "wxc" (this is because C++ can't link code from two different versions...) You can use e.g. "g++-3.3" and "g++-4.0" as the CXX compiler names. --anders
Jan 05 2006
parent reply Fredrik Olsson <peylow gmail.com> writes:
Anders F Björklund skrev:
 Fredrik Olsson wrote:
 
 Must wxWidgets be recompiled as well?
Yes, you must compile wxWidgets with the same C++ version as "wxc" (this is because C++ can't link code from two different versions...) You can use e.g. "g++-3.3" and "g++-4.0" as the CXX compiler names. --anders
It is compiled with the same version. First I compiled wxWidgets, and then wxd, it failed on Tiger, so I recompiled wxd without -lcc_dynamic, and got this error. So what I meant is if I need to recompile wxWidgets as well, as part of the "Tiger fix"? // Fredrik Olsson
Jan 05 2006
parent =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
Fredrik Olsson wrote:

 It is compiled with the same version. First I compiled wxWidgets, and 
 then wxd, it failed on Tiger, so I recompiled wxd without -lcc_dynamic, 
 and got this error.
 
 So what I meant is if I need to recompile wxWidgets as well, as part of 
 the "Tiger fix"?
They're not *really* related. The addition of libgcc.a (via the symlink libcc_dynamic.a -> /usr/lib/gcc/darwin/default/libgcc.a) was done in order to fix the link errors "restFP" and "saveFP", when compiling on Panther. (like this: http://nxg.me.uk/note/2004/restFP/) What it says is that it isn't able to find the C++ typeinfo, which I saw when I was trying to run G++-3.3 progs with G++-4.0... Maybe it's some other error in your case ? You could try compiling wxWidgets dynamically ? --anders
Jan 05 2006
prev sibling next sibling parent reply S. Chancellor <S._member pathlink.com> writes:
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.




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.
Jan 04 2006
parent reply =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
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
Jan 04 2006
parent reply S. Chancellor<dnewsgr mephit.kicks-ass.org> writes:
=?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> wrote:
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
Okay, that makes sense :) I hope Walter introduces a name mangling specification and vtbl format etc... so that the same problems don't befall D :) -S. -- Email works.
Jan 05 2006
parent =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
S. Chancellor wrote:

 Okay, that makes sense :)  I hope Walter introduces a name mangling
 specification and vtbl format etc... so that the same problems don't befall
 D :)
Too late... :-P Already have to build two different libs: one for GDC, one for DMD. (different ABI, different Phobos). It seems only "C" is constant*... --anders * 1,079,252,848.8 km/h :-)
Jan 05 2006
prev sibling next sibling parent reply Juan Jose Comellas <jcomell hotmail.com> writes:
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.
 

 
 
 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.
Jan 04 2006
next sibling parent =?UTF-8?B?QW5kZXJzIEYgQmrDtnJrbHVuZA==?= <afb algonet.se> writes:
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
Jan 04 2006
prev sibling next sibling parent reply BERO <berobero users.sourceforge.net> writes:
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, by hand. I think you can use same way. http://qtcsharp.sourceforge.net/ so "C wrappers for the C++ methods" is already exists. BERO
Jan 04 2006
parent reply =?UTF-8?B?QW5kZXJzIEYgQmrDtnJrbHVuZA==?= <afb algonet.se> writes:
BERO wrote:

 I was taken it from wx.NET,


 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.

 http://qtcsharp.sourceforge.net/
 

 so "C wrappers for the C++ methods" is already exists.
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
Jan 05 2006
parent =?UTF-8?B?SmFyaS1NYXR0aSBNw6RrZWzDpA==?= <jmjmak utu.fi.invalid> writes:
Anders F Björklund wrote:
 BERO wrote:
 
 I was taken it from wx.NET,


 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.

 http://qtcsharp.sourceforge.net/


 so "C wrappers for the C++ methods" is already exists.
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)
I, on the other hand, am eagerly waiting for this QT-wrapper. Qt is a quality product (much better code than GTK+) and the license alternatives aren't that bad for home users and bigger enterprises. Jari-Matti
Jan 11 2006
prev sibling parent "Craig Black" <cblack ara.com> writes:
"Juan Jose Comellas" <jcomell hotmail.com> wrote in message 
news:dphl9e$qrg$1 digitaldaemon.com...
 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.
If you port Qt to D you will be my hero forever. -Craig
Jan 16 2006
prev sibling parent reply "Craig Black" <cblack ara.com> writes:
Does wxD have cross-platform OpenGL support?  If not, when?

-Craig 
Jan 16 2006
parent =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
Craig Black wrote:

 Does wxD have cross-platform OpenGL support?  If not, when?
There *is* support in wxWidgets for OpenGL (wxGLCanvas), and there is support in D for using OpenGL - but not in wxD yet. Mostly because it wasn't in wx.NET version 0.7.2, actually... If anyone wants to write the needed wrappers for wxc / wxd, we'd be more than happy to include them in wxD of course :-) (http://www.wxwidgets.org/manuals/2.6.1/wx_wxglcanvas.html) You can use http://sourceforge.net/tracker/?group_id=133831 --anders
Jan 16 2006