www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.dwt - dwt-samples

reply Ty Tower <tytower hotmail.com.au> writes:
You shold tell people that other download formats such as bz2 gz zip 
are available from
http://hg.dsource.org/projects/dwt-samples/rev/8d49c4eb4800
Feb 11 2008
parent reply Ty Tower <tytower hotmail.com.au> writes:
Ok so I have the examples in directory dwt/dwtexampes   now I want to compile
them on a linux machine. Did you say this was not yet possible?

If I want to get a look at the folowing ...how do I do it 
[code]
module dwtexamples.helloworld.HelloWorld1;


import dwt.widgets.Display;
import dwt.widgets.Shell;

/*
 * This example demonstrates the minimum amount of code required
 * to open an DWT Shell and process the events.
 */
void main(){
    Display display = new Display ();
    Shell shell = new Shell (display);
    shell.open ();
    while (!shell.isDisposed ()) {
        if (!display.readAndDispatch ()) display.sleep ();
    }
    display.dispose ();
}

// for unknown reason, there are linker errors. These imports are the workaround
import tango.io.Stdout;
import tango.math.Math;
import tango.text.convert.Format;
import tango.util.Convert;
import tango.util.PathUtil;

[/code]
Feb 11 2008
parent reply Jesse Phillips <jessekphillips gmail.com> writes:
On Mon, 11 Feb 2008 05:41:57 -0500, Ty Tower wrote:

 Ok so I have the examples in directory dwt/dwtexampes   now I want to
 compile them on a linux machine. Did you say this was not yet possible?
 
 If I want to get a look at the folowing ...how do I do it [code]
 module dwtexamples.helloworld.HelloWorld1;
 
 
 import dwt.widgets.Display;
 import dwt.widgets.Shell;
 
 /*
  * This example demonstrates the minimum amount of code required * to
  open an DWT Shell and process the events. */
 void main(){
     Display display = new Display ();
     Shell shell = new Shell (display);
     shell.open ();
     while (!shell.isDisposed ()) {
         if (!display.readAndDispatch ()) display.sleep ();
     }
     display.dispose ();
 }
 
 // for unknown reason, there are linker errors. These imports are the
 workaround import tango.io.Stdout;
 import tango.math.Math;
 import tango.text.convert.Format;
 import tango.util.Convert;
 import tango.util.PathUtil;
 
 [/code]

Ty Tower, The samples should work in linux. I don't see why you would need to import any tango libraries. I use DSSS to do the building for me as there are a lot of libs it links in.
Feb 11 2008
parent reply Ty Tower <tytower hotmail.com.au> writes:
Jesse Phillips Wrote:
 The samples should work in linux. I don't see why you would need to 
 import any tango libraries. I use DSSS to do the building for me as there 
 are a lot of libs it links in.

Well Jesse thats not quite my question. the code is from the actual program and frank says there is a bug in it and importing those libraries fixes it atm So I have dsss too and I am trying to understand how it works ,but the dsss.conf file that comes with the samples does not seem to get me anywhere atm. That is the question ---I have dwt installed , how do I install the samples so that I can build and inspect them all?
Feb 11 2008
parent reply Frank Benoit <keinfarbton googlemail.com> writes:
Ty Tower schrieb:
 Jesse Phillips Wrote:
 The samples should work in linux. I don't see why you would need to 
 import any tango libraries. I use DSSS to do the building for me as there 
 are a lot of libs it links in.

Well Jesse thats not quite my question. the code is from the actual program and frank says there is a bug in it and importing those libraries fixes it atm So I have dsss too and I am trying to understand how it works ,but the dsss.conf file that comes with the samples does not seem to get me anywhere atm. That is the question ---I have dwt installed , how do I install the samples so that I can build and inspect them all?

in dwt-linux dir do: $ dsss build dwt $ dsss install dwt in dwt-samples dir do: $ dsss build dwtexamples/helloworld/HelloWorld1.d This should create the executable 'dwtexamples/helloworld/HelloWorld1'. Without those imports - as the comment says - you might get linker errors. you can also try $ dsss build ... and all samples should be built.
Feb 11 2008
parent reply Ty Tower <tytower hotmail.com.au> writes:
Thanks Frank 
did as suggested dwt-linux looks to have gone OK
dwt-samples not so but you did warn me I think

got this back on both "dsss build"  and "dsss build
dwtexamples/helloworld/HelloWorld1.d"


/usr/lib/gcc/i586-mandriva-linux-gnu/4.1.2/../../../libphobos.a(l
nux.o):(.data+0x0): multiple definition of `MAP_FAILED'
dsss_objs/D/tango.stdc.posix.sys.mman.o:(.data+0x1c): first defined here
/usr/lib/gcc/i586-mandriva-linux-gnu/4.1.2/../../../libphobos.a(l
nux.o):(.data+0x4): multiple definition of `FD_SETSIZE'
dsss_objs/D/tango.stdc.posix.sys.select.o:(.data+0x4): first defined here
/usr/lib/gcc/i586-mandriva-linux-gnu/4.1.2/../../../libphobos.a(l
nux.o):(.data+0xc): multiple definition of `RTLD_NOW'
dsss_objs/D/tango.stdc.posix.dlfcn.o:(.data+0x4): first defined here
/usr/lib/gcc/i586-mandriva-linux-gnu/4.1.2/../../../libphobos.a(li
ux.o):(.data+0x10): multiple definition of `_SIGSET_NWORDS'
dsss_objs/D/tango.stdc.posix.signal.o:(.data+0x40): first defined here
/usr/bin/ld: cannot find -lXdamage
collect2: ld returned 1 exit status
--- errorlevel 1
Command /usr/bin/rebuild returned with code 65280, aborting.
Error: Command failed, aborting.

Looked in /usr/bin/ and ld is there . What is it telling me it can't find?  
What does -IXdamage mean?
Feb 11 2008
next sibling parent reply Frank Benoit <keinfarbton googlemail.com> writes:
Ty Tower schrieb:
 Thanks Frank 
 did as suggested dwt-linux looks to have gone OK
 dwt-samples not so but you did warn me I think
 
 got this back on both "dsss build"  and "dsss build
dwtexamples/helloworld/HelloWorld1.d"
 
 
 /usr/lib/gcc/i586-mandriva-linux-gnu/4.1.2/../../../libphobos.a(l
nux.o):(.data+0x0): multiple definition of `MAP_FAILED'
 dsss_objs/D/tango.stdc.posix.sys.mman.o:(.data+0x1c): first defined here
 /usr/lib/gcc/i586-mandriva-linux-gnu/4.1.2/../../../libphobos.a(l
nux.o):(.data+0x4): multiple definition of `FD_SETSIZE'
 dsss_objs/D/tango.stdc.posix.sys.select.o:(.data+0x4): first defined here
 /usr/lib/gcc/i586-mandriva-linux-gnu/4.1.2/../../../libphobos.a(l
nux.o):(.data+0xc): multiple definition of `RTLD_NOW'
 dsss_objs/D/tango.stdc.posix.dlfcn.o:(.data+0x4): first defined here
 /usr/lib/gcc/i586-mandriva-linux-gnu/4.1.2/../../../libphobos.a(li
ux.o):(.data+0x10): multiple definition of `_SIGSET_NWORDS'
 dsss_objs/D/tango.stdc.posix.signal.o:(.data+0x40): first defined here
 /usr/bin/ld: cannot find -lXdamage
 collect2: ld returned 1 exit status
 --- errorlevel 1
 Command /usr/bin/rebuild returned with code 65280, aborting.
 Error: Command failed, aborting.
 
 Looked in /usr/bin/ and ld is there . What is it telling me it can't find?  
 What does -IXdamage mean?
 

this look like you use gdc. goto the dsss install dir, find the file etc/rebuild/default change the content to "dmd-posix-tango", to ensure both dmd and tango are used.
Feb 11 2008
parent Frank Benoit <keinfarbton googlemail.com> writes:
Frank Benoit schrieb:
 this look like you use gdc.
 goto the dsss install dir, find the file etc/rebuild/default
 change the content to "dmd-posix-tango", to ensure both dmd and tango 
 are used.

or its simply that dsss thinks to use dmd/phobos. Still, change the default compiler profile as said above.
Feb 11 2008
prev sibling parent reply Frank Benoit <keinfarbton googlemail.com> writes:
Please give IRC a try. If you have luck, someone (perhaps me) can help 
you directly in #dwt on freenode.
Feb 11 2008
parent reply Ty Tower <tytower hotmail.com.au> writes:
Frank Benoit Wrote:

 Please give IRC a try. If you have luck, someone (perhaps me) can help 
 you directly in #dwt on freenode.

I don't use IRC. I do use dmd but I think gcc is installed but this should not affect anything I have found the file /etc/rebuild/default and changed its one line text to "dmd-linux-tango I have also found the file /dsss/rebuild.conf/default and changed its contents to "dmd-linux-tango" This has not changed the result as yet . Is there more to be done ?
Feb 11 2008
parent Frank Benoit <keinfarbton googlemail.com> writes:
Ty Tower schrieb:
 Frank Benoit Wrote:
 
 Please give IRC a try. If you have luck, someone (perhaps me) can help 
 you directly in #dwt on freenode.

I don't use IRC. I do use dmd but I think gcc is installed but this should not affect anything I have found the file /etc/rebuild/default and changed its one line text to "dmd-linux-tango I have also found the file /dsss/rebuild.conf/default and changed its contents to "dmd-linux-tango" This has not changed the result as yet . Is there more to be done ?

dmd-posix-tango, not dmd-linux-tango this make dsss use the etc/rebuild/dmd-posix-tango file (called compiler-profile) and while you are at it, as written in the dwt-linux/REAMD customize the oneatatime option.
Feb 12 2008