www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.dwt - Need Help on Compiling DWT2 in XP

reply Sam Hu <samhu.samhu gmail.com> writes:
Hi ,I am going to compiling DWT2 +tango 0998+rake.I have done below steps:
1.Download Tango0998+DMD1.041
2.Download dmc from:
http://www.digitalmars.com/d/2.0/dmd-windows.html
Up to now the D folder is as below:
c:\
----dmd\
----dm
3.Download and install ruby to C:\  from http://www.ruby-lang.org/en/downloads/
The version I chose is Ruby 1.8.6-one-click-installer
Now I have C:\ruby
4.Install rake:
In folder C:\ruby\bin:
gem install --remote rake

5.Install TortoiseHg0.72 to c:\program files\ from below link: http://bitbucket.org/tortoisehg/stable/wiki/Home 6.In c:\dmd\import there are two subfolders:C:\dmd\std and c:\dmd\tango. Create a new folder c:\dmd\import\dwt2; 7.Right from c:\dmd\import right click mouse tortoiseHG->Clone a Respository: Source Path:http://hg.dsource.org/projects/dwt2 Destination Path:c:\dmd\import\dwt2 Leave the other options default. OK.All above have been done without any error and HG proceeded completed and successfully. What should I do in next step?Please guide me.Thanks. Regards, Sam
Mar 31 2009
next sibling parent Sam Hu <samhu.samhu gmail.com> writes:
1.I also noticed that in C:\dm\lib there are 18 lib files where there are only
12 lib files in C:\dmd\lib.
2.Update:there is a typo regarding folder C:\dmd\import.All the D files in C
drive is as below:
c:\
----dm\
----dmd\
----dmd\bin\
----dmd\lib\
----dmd\example\
----dmd\import\
----dmd\import\std\
----dmd\import\tango\
----dmd\import\dwt2--------Created by myself where dwt2 was downloaded to.
Mar 31 2009
prev sibling parent reply Frank Benoit <keinfarbton googlemail.com> writes:
Sam Hu schrieb:
 Hi ,I am going to compiling DWT2 +tango 0998+rake.I have done below steps:
 1.Download Tango0998+DMD1.041
 2.Download dmc from:
 http://www.digitalmars.com/d/2.0/dmd-windows.html
 Up to now the D folder is as below:
 c:\
 ----dmd\
 ----dm
 3.Download and install ruby to C:\  from http://www.ruby-lang.org/en/downloads/
 The version I chose is Ruby 1.8.6-one-click-installer
 Now I have C:\ruby
 4.Install rake:
 In folder C:\ruby\bin:
 gem install --remote rake

5.Install TortoiseHg0.72 to c:\program files\ from below link: http://bitbucket.org/tortoisehg/stable/wiki/Home 6.In c:\dmd\import there are two subfolders:C:\dmd\std and c:\dmd\tango. Create a new folder c:\dmd\import\dwt2; 7.Right from c:\dmd\import right click mouse tortoiseHG->Clone a Respository: Source Path:http://hg.dsource.org/projects/dwt2 Destination Path:c:\dmd\import\dwt2 Leave the other options default. OK.All above have been done without any error and HG proceeded completed and successfully. What should I do in next step?Please guide me.Thanks. Regards, Sam

Hi I have made changes to dwt2 to work it like the following receipt. Download the tango release and dwt2 to c:\Project\tango-0.99.8-bin-win32-dmd.1.041 c:\Project\dwt2 Then add dmd to the PATH C:\Project> set PATH=%PATH%;c:\Project\tango-0.99.8-bin-win32-dmd.1.041\bin Verify the dmd version C:\Project> dmd Digital Mars D Compiler v1.041 ... Then build the libs and snippets C:\Project\dwt2> rake clean base swt (in C:/Project/dwt2) Cleaning Building dwt-base Building org.eclipse.swt.win32.win32.x86 C:\Project\dwt2> rake swtsnippets Building swtsnippets[Snippet10] Building swtsnippets[Snippet107] Building swtsnippets[Snippet108] Building swtsnippets[Snippet109] Building swtsnippets[Snippet111] ... (Cancel with Ctrl+C) C:\Project\dwt2> bin\SwtSnippet10.exe To build your own application... Add the 'imp' dir to your import search path: -IC:\Project\dwt2\imp Add the 'lib' dir to your library search path: -L+C:\Project\dwt2\lib\ Add all needed libraries to the commandline: -L+advapi32.lib -L+comctl32.lib -L+comdlg32.lib -L+gdi32.lib -L+kernel32.lib -L+shell32.lib -L+ole32.lib -L+oleaut32.lib -L+olepro32.lib -L+oleacc.lib -L+user32.lib -L+usp10.lib -L+msimg32.lib -L+opengl32.lib -L+shlwapi.lib -L+zlib.lib -L+dwt-base.lib -L+org.eclipse.swt.win32.win32.x86.lib Frank
Apr 01 2009
parent reply Sam Hu <samhu.samhu gmail.com> writes:
Add the 'imp' dir to your import search path:
 -IC:\Project\dwt2\imp
 Add the 'lib' dir to your library search path:
 -L+C:\Project\dwt2\lib\
 Add all needed libraries to the commandline:
 -L+advapi32.lib
 -L+comctl32.lib
 -L+comdlg32.lib
 -L+gdi32.lib
 -L+kernel32.lib
 -L+shell32.lib
 -L+ole32.lib
 -L+oleaut32.lib
 -L+olepro32.lib
 -L+oleacc.lib
 -L+user32.lib
 -L+usp10.lib
 -L+msimg32.lib
 -L+opengl32.lib
 -L+shlwapi.lib
 -L+zlib.lib
 -L+dwt-base.lib
 -L+org.eclipse.swt.win32.win32.x86.lib
 

Apr 01 2009
parent reply Frank Benoit <keinfarbton googlemail.com> writes:
Sam Hu schrieb:
 Add the 'imp' dir to your import search path:
 -IC:\Project\dwt2\imp
 Add the 'lib' dir to your library search path:
 -L+C:\Project\dwt2\lib\
 Add all needed libraries to the commandline:
 -L+advapi32.lib
 -L+comctl32.lib
 -L+comdlg32.lib
 -L+gdi32.lib
 -L+kernel32.lib
 -L+shell32.lib
 -L+ole32.lib
 -L+oleaut32.lib
 -L+olepro32.lib
 -L+oleacc.lib
 -L+user32.lib
 -L+usp10.lib
 -L+msimg32.lib
 -L+opengl32.lib
 -L+shlwapi.lib
 -L+zlib.lib
 -L+dwt-base.lib
 -L+org.eclipse.swt.win32.win32.x86.lib


Yeah, it should be possible. I tried the pragma(lib, ..) but unfortunately it seems to me, there is a dmd bug. http://d.puremagic.com/issues/show_bug.cgi?id=2776 Frank
Apr 01 2009
parent reply Sam Hu <samhu.samhu gmail.com> writes:
Hi Frank,

Doe it work if we add these -I and -L into the sc.ini file?

Sam
Apr 01 2009
parent reply Sam Hu <samhu.samhu gmail.com> writes:
Hi Frank,

I compiled DWT2 successfuly base on your path/folders.But I have  a couple of
questions:
1.How do I compile my own d program which is not in the swtsnippets folder,say
in anohter drive,D:\dprogram\ex?How is the command look like--rake ???
2.Is jface and other packages such as
draw2d,core.job,core.runtime,jface.text,osgi,ui.forms,text,and tools compilable
and workable at this moment,if yes,how to compile?
3.Is dssss still workable to compile DWT2 program?

Thanks and best regards,
Sam
Apr 01 2009
parent reply Frank Benoit <keinfarbton googlemail.com> writes:
Sam Hu schrieb:
 Hi Frank,
 
 I compiled DWT2 successfuly base on your path/folders.But I have  a couple of
questions:
 1.How do I compile my own d program which is not in the swtsnippets folder,say
in anohter drive,D:\dprogram\ex?How is the command look like--rake ???

If you compile your own app, you can use whatever build system you want.
 2.Is jface and other packages such as
draw2d,core.job,core.runtime,jface.text,osgi,ui.forms,text,and tools compilable
and workable at this moment,if yes,how to compile?

Yes, you can show the other rake build targets with
 rake -T

 3.Is dssss still workable to compile DWT2 program?

Yes, you can just put all those -I and -J and -L into the dsss.conf But dwt2 is not to be build itself by dsss. And it is not installed into dsss.
Apr 02 2009
next sibling parent reply Sam Hu <samhu.samhu gmail.com> writes:
Hi Frank,

I re-built DWT2 with rake clean all and everything went smoothly and
successfully;But when I tried to build a my own pragram (testDWT2.d)which is
placed in the C:\TangoD\dwt2\org.eclipse.jface.snippets\EclipseJfaceSnippets\org\eclipse\jf
ce\snippets\viewers folder with the command:rake jfacesnippets,it failed with
below error:

C:\TangoD\dwt2>rake jfacesnippets
(in C:/TangoD/dwt2)
Building jfacesnippets[Snippet001TableViewer]
dmd.exe  C:\TangoD\dwt2\rsp
......
Building jfacesnippets[testDWT2]
dmd.exe  C:\TangoD\dwt2\rsp
ppets\testDWT2.d: module testDWT2 cannot read file 'ppets\testDWT2.d'
rake aborted!
compile error
C:/TangoD/dwt2/rakefile:274:in `buildApp'
(See full trace by running task with --trace)

I just have no idea how to compile my own program,although you have memtioned
above,forgive me !
C:\TangoD\dwt2> 
 3.Is dssss still workable to compile DWT2 program?

Yes, you can just put all those -I and -J and -L into the dsss.conf But dwt2 is not to be build itself by dsss. And it is not installed into dsss.

My d folder now: c:\tangoD --------\dmd --------\dwt2 --------\dsss --------\dsss\bin --------\dsss\lib --------\dsss\include 1.Copy all dwt2 lib files into dsss\lib; 2.copy all dwt2 res files into dsss\lib\res; 3.copy all dwt2 imp files (that's \java folder and \org folder under dwt2\imp into dsss\include\d,dsss\include folder now looks like below: --------\dsss\include\d\java --------\dsss\include\d\org 4.In d:\dex where is my own d program files.Say,here is a d program name testDWT2.d; 5.write a dsss.conf and save in d:\dex,the content of d:\dex\dsss.conf is as below: # DWT dwt-samples top-level dsss.conf [*] buildflags+=-g -gc buildflags+=-J$LIB_PREFIX/res -Jres version(Windows) { # if no console window is wanted/needed use -version=gui version(gui) { buildflags+= -L/SUBSYSTEM:windows:5 } else { buildflags+= -L/SUBSYSTEM:console:5 } buildflags+= -L/rc:java buildflags+= -L/rc:org buildflags += -L"zlib;libbz2" } [testDWT2.d] version(DwtAddons){ [jface] type=subdir } 6.when I compile with dsss build testDWT2.d,dozens of error msg : D:\Laguage\Dex>dsss build testDWT2.d testDWT2.d => testDWT2 + c:\tangoD\dsss\bin\rebuild.exe -Idsss_imports\ -I. -S.\ -Ic:\tangoD\dsss\inclu de\d -Sc:\tangoD\dsss\lib\ -Ic:\tangoD\dsss\include\d -Sc:\tangoD\dsss\lib -oq dsss_objs\D testDWT2.d -oftestDWT2 c:/tangoD/dsss/bin\..\include\d\java\lang\util.di(296): Error: need -Jpath switc h to import text file org.eclipse.swt.internal.SWTMessages.properties c:/tangoD/dsss/bin\..\include\d\java\lang\util.di(296): Error: cannot evaluate o pCall("","org.eclipse.swt.internal.SWTMessages.properties") at compile time c:/tangoD/dsss/bin\..\include\d\java\lang\util.di(206): template instance java.l ang.util.getImportData!("org.eclipse.swt.internal.SWTMessages.properties") error instantiating c:/tangoD/dsss/bin\..\include\d\org\eclipse\swt\internal\Compatibility.di(206): Error: cannot evaluate opCall("","org.eclipse.swt.internal.SWTMessages.propertie s") at compile time Command c:\tangoD\dsss\bin\rebuild.exe returned with code 1, aborting. Error: Command failed, aborting. D:\Laguage\Dex> This is all what I have done with dsss+tango+dwt2 but it seems just what a mess.So it would be grateful if you would like to write a simple step by step guideline the newbies like me to set up a working environment as quickly as possible. Thanks and best regards, Sam
Apr 06 2009
parent Sam Hu <samhu.samhu gmail.com> writes:
Sam Hu Wrote:

 Hi Frank,
 
 I re-built DWT2 with rake clean all and everything went smoothly and
successfully;But when I tried to build a my own pragram (testDWT2.d)which is
placed in the C:\TangoD\dwt2\org.eclipse.jface.snippets\EclipseJfaceSnippets\org\eclipse\jf
ce\snippets\viewers folder with the command:rake jfacesnippets,it failed with
below error:
 
 C:\TangoD\dwt2>rake jfacesnippets
 (in C:/TangoD/dwt2)
 Building jfacesnippets[Snippet001TableViewer]
 dmd.exe  C:\TangoD\dwt2\rsp
 ......
 Building jfacesnippets[testDWT2]
 dmd.exe  C:\TangoD\dwt2\rsp
 ppets\testDWT2.d: module testDWT2 cannot read file 'ppets\testDWT2.d'
 rake aborted!
 compile error
 C:/TangoD/dwt2/rakefile:274:in `buildApp'
 (See full trace by running task with --trace)
 
 I just have no idea how to compile my own program,although you have memtioned
above,forgive me !
 C:\TangoD\dwt2> 
 3.Is dssss still workable to compile DWT2 program?

Yes, you can just put all those -I and -J and -L into the dsss.conf But dwt2 is not to be build itself by dsss. And it is not installed into dsss.

My d folder now: c:\tangoD --------\dmd --------\dwt2 --------\dsss --------\dsss\bin --------\dsss\lib --------\dsss\include 1.Copy all dwt2 lib files into dsss\lib; 2.copy all dwt2 res files into dsss\lib\res; 3.copy all dwt2 imp files (that's \java folder and \org folder under dwt2\imp into dsss\include\d,dsss\include folder now looks like below: --------\dsss\include\d\java --------\dsss\include\d\org 4.In d:\dex where is my own d program files.Say,here is a d program name testDWT2.d; 5.write a dsss.conf and save in d:\dex,the content of d:\dex\dsss.conf is as below: # DWT dwt-samples top-level dsss.conf [*] buildflags+=-g -gc buildflags+=-J$LIB_PREFIX/res -Jres version(Windows) { # if no console window is wanted/needed use -version=gui version(gui) { buildflags+= -L/SUBSYSTEM:windows:5 } else { buildflags+= -L/SUBSYSTEM:console:5 } buildflags+= -L/rc:java buildflags+= -L/rc:org buildflags += -L"zlib;libbz2" } [testDWT2.d] version(DwtAddons){ [jface] type=subdir } 6.when I compile with dsss build testDWT2.d,dozens of error msg : D:\Laguage\Dex>dsss build testDWT2.d testDWT2.d => testDWT2 + c:\tangoD\dsss\bin\rebuild.exe -Idsss_imports\ -I. -S.\ -Ic:\tangoD\dsss\inclu de\d -Sc:\tangoD\dsss\lib\ -Ic:\tangoD\dsss\include\d -Sc:\tangoD\dsss\lib -oq dsss_objs\D testDWT2.d -oftestDWT2 c:/tangoD/dsss/bin\..\include\d\java\lang\util.di(296): Error: need -Jpath switc h to import text file org.eclipse.swt.internal.SWTMessages.properties c:/tangoD/dsss/bin\..\include\d\java\lang\util.di(296): Error: cannot evaluate o pCall("","org.eclipse.swt.internal.SWTMessages.properties") at compile time c:/tangoD/dsss/bin\..\include\d\java\lang\util.di(206): template instance java.l ang.util.getImportData!("org.eclipse.swt.internal.SWTMessages.properties") error instantiating c:/tangoD/dsss/bin\..\include\d\org\eclipse\swt\internal\Compatibility.di(206): Error: cannot evaluate opCall("","org.eclipse.swt.internal.SWTMessages.propertie s") at compile time Command c:\tangoD\dsss\bin\rebuild.exe returned with code 1, aborting. Error: Command failed, aborting. D:\Laguage\Dex> This is all what I have done with dsss+tango+dwt2 but it seems just what a mess.So it would be grateful if you would like to write a simple step by step guideline the newbies like me to set up a working environment as quickly as possible. Thanks and best regards, Sam

Apr 07 2009
prev sibling parent reply %u <free2000fly sohu.com> writes:
dmd:
Digital Mars D Compiler v1.042

Tango:
http://svn.dsource.org/projects/tango/trunk

DWT2:
http://hg.dsource.org/projects/dwt2/

========================================================================================

rake core          # Build Eclipse Core
rake jfacetext     # Build JFace.Text

C:\dmd1042\dmd\src\dwt2>rake jfacetext
(in C:/dmd1042/dmd/src/dwt2)
Building org.eclipse.text
Building org.eclipse.jface.text.projection
../src\org\eclipse\jface\text\AbstractHoverInformationControlManager.d(183): Err
or: module Job cannot read file 'org\eclipse\core\runtime\jobs\Job.d'
rake aborted!
compile error
C:/dmd1042/dmd/src/dwt2/rakefile:161:in `buildTree'
(See full trace by running task with --trace)

C:\dmd1042\dmd\src\dwt2>rake jfacetext
(in C:/dmd1042/dmd/src/dwt2)
Building org.eclipse.text
Building org.eclipse.jface.text.projection
../src\org\eclipse\jface\text\AbstractHoverInformationControlManager.d(183): Err
or: module Job cannot read file 'org\eclipse\core\runtime\jobs\Job.d'
rake aborted!
compile error
C:/dmd1042/dmd/src/dwt2/rakefile:161:in `buildTree'
(See full trace by running task with --trace)

========================================================================================

================================== WinApp01.d
===================================
import std.c.windows.windows;
import std.c.stdio;


import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

void _main ()
{
    auto display = new Display;
    auto shell = new Shell(display);
    shell.setText = "Hello DWT World from
http://bbs.d-programming-language-china.org/ ";
    shell.open;
    while (!shell.isDisposed)
        if (!display.readAndDispatch)
            display.sleep;

    display.dispose;
}


extern (C) void gc_init();
extern (C) void gc_term();
extern (C) void _minit();
extern (C) void _moduleCtor();
extern (C) void _moduleUnitTests();

extern (Windows)
int WinMain(HINSTANCE hInstance,
    HINSTANCE hPrevInstance,
    LPSTR lpCmdLine,
    int nCmdShow)
{
    int nResult = 0;

    gc_init();			// initialize garbage collector
    _minit();			// initialize module constructor table

    try
    {
	_moduleCtor();		// call module constructors
	_moduleUnitTests();	// run unit tests (optional)

        _main();
	// result = doit();	// insert user code here
    }

    catch (Object o)		// catch any uncaught exceptions
    {
	MessageBoxA(null, cast(char *)o.toString(), "Error",
		    MB_OK | MB_ICONEXCLAMATION);
	nResult = 0;		// failed
    }

    gc_term();			// run finalizers; terminate garbage collector


    return nResult;
}

======================================================================================

-------------- Build: Debug in WinApp01 ---------------

Compiling: hello.d
C:\dmd1042\dmd\windows\bin\..\..\..\dmd\src\dwt2\imp\java\lang\wrappers.di(48):
Error: identifier 'equals_t' is not defined
C:\dmd1042\dmd\windows\bin\..\..\..\dmd\src\dwt2\imp\java\lang\wrappers.di(48):
Error: equals_t is used as a type
C:\dmd1042\dmd\windows\bin\..\..\..\dmd\src\dwt2\imp\java\lang\wrappers.di(48):
Error: function java.lang.wrappers.ArrayWrapperT!
(byte).ArrayWrapperT.opEquals of type void(Object o) overrides but is not
covariant with object.Object.opEquals of type int(Object o)
C:\dmd1042\dmd\windows\bin\..\..\..\dmd\src\dwt2\imp\java\lang\wrappers.di(48):
Error: function java.lang.wrappers.ArrayWrapperT!
(byte).ArrayWrapperT.opEquals does not override any function
C:\dmd1042\dmd\windows\bin\..\..\..\dmd\src\dwt2\imp\java\la
g\wrappers.di(157): Error: template instance
java.lang.wrappers.ArrayWrapperT!(byte) error
instantiating
Process terminated with status 1 (0 minutes, 1 seconds)
5 errors, 0 warnings
Apr 09 2009
parent Frank Benoit <keinfarbton googlemail.com> writes:
%u schrieb:
 .../src\org\eclipse\jface\text\AbstractHoverInformationControlManager.d(183):
Err
 or: module Job cannot read file 'org\eclipse\core\runtime\jobs\Job.d'
 rake aborted!

the module should be build with "rake core". To ensure everything is build, just run "rake".
 -------------- Build: Debug in WinApp01 ---------------
 
 Compiling: hello.d
 C:\dmd1042\dmd\windows\bin\..\..\..\dmd\src\dwt2\imp\java\l
ng\wrappers.di(48): Error: identifier 'equals_t' is not defined
 C:\dmd1042\dmd\windows\bin\..\..\..\dmd\src\dwt2\imp\java\l
ng\wrappers.di(48): Error: equals_t is used as a type
 C:\dmd1042\dmd\windows\bin\..\..\..\dmd\src\dwt2\imp\java\l
ng\wrappers.di(48): Error: function java.lang.wrappers.ArrayWrapperT!
 (byte).ArrayWrapperT.opEquals of type void(Object o) overrides but is not
covariant with object.Object.opEquals of type int(Object o)
 C:\dmd1042\dmd\windows\bin\..\..\..\dmd\src\dwt2\imp\java\l
ng\wrappers.di(48): Error: function java.lang.wrappers.ArrayWrapperT!
 (byte).ArrayWrapperT.opEquals does not override any function
 C:\dmd1042\dmd\windows\bin\..\..\..\dmd\src\dwt2\imp\java\la
g\wrappers.di(157): Error: template instance
java.lang.wrappers.ArrayWrapperT!(byte) error
 instantiating
 Process terminated with status 1 (0 minutes, 1 seconds)
 5 errors, 0 warnings

equals_t is defined in tango object.di, so there is perhaps something wrong in your install?
Apr 10 2009